@hw-component/table 1.10.15 → 1.10.17
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/EditTable/hooks.d.ts +12 -2
- package/es/EditTable/hooks.js +88 -45
- package/es/EditTable/index.js +9 -13
- package/es/EditTable/modal.d.ts +1 -1
- package/es/HTableBody/Options/hooks.d.ts +6 -3
- package/es/HTableBody/Options/hooks.js +56 -29
- package/es/HTableBody/Options/index.js +8 -6
- package/es/HTableBody/Options/utils.d.ts +2 -2
- package/es/HTableBody/hooks/useColData.d.ts +3 -8
- package/es/HTableBody/hooks/useColData.js +51 -119
- package/es/HTableBody/hooks/useColMk.d.ts +3 -0
- package/es/HTableBody/hooks/useColMk.js +100 -0
- package/es/HTableBody/index.js +14 -18
- package/lib/EditTable/hooks.d.ts +12 -2
- package/lib/EditTable/hooks.js +87 -44
- package/lib/EditTable/index.js +9 -13
- package/lib/EditTable/modal.d.ts +1 -1
- package/lib/HTableBody/Options/hooks.d.ts +6 -3
- package/lib/HTableBody/Options/hooks.js +56 -29
- package/lib/HTableBody/Options/index.js +7 -5
- package/lib/HTableBody/Options/utils.d.ts +2 -2
- package/lib/HTableBody/hooks/useColData.d.ts +3 -8
- package/lib/HTableBody/hooks/useColData.js +49 -118
- package/lib/HTableBody/hooks/useColMk.d.ts +3 -0
- package/lib/HTableBody/hooks/useColMk.js +103 -0
- package/lib/HTableBody/index.js +13 -17
- package/package.json +1 -1
- package/src/components/EditTable/hooks.ts +54 -20
- package/src/components/EditTable/index.tsx +12 -16
- package/src/components/EditTable/modal.ts +1 -1
- package/src/components/HTableBody/Options/hooks.tsx +39 -21
- package/src/components/HTableBody/Options/index.tsx +3 -3
- package/src/components/HTableBody/hooks/useColData.tsx +38 -110
- package/src/components/HTableBody/hooks/useColMk.ts +83 -0
- package/src/components/HTableBody/index.tsx +7 -10
- package/src/pages/ModalEditTable/index.tsx +38 -26
- package/src/pages/Table/index.tsx +143 -104
package/es/EditTable/hooks.d.ts
CHANGED
|
@@ -2,12 +2,21 @@ import { HEditTableProps } from "./modal";
|
|
|
2
2
|
import { MutableRefObject } from "react";
|
|
3
3
|
import type { ActionType } from "@ant-design/pro-table";
|
|
4
4
|
import { EditableFormInstance } from "@ant-design/pro-table/lib/components/EditableTable";
|
|
5
|
-
|
|
5
|
+
import { ResultModal } from "../modal";
|
|
6
|
+
export declare const useListRequest: ({ request, dataSource, manual, }: HEditTableProps) => {
|
|
7
|
+
loading: boolean;
|
|
8
|
+
error: Error | undefined;
|
|
9
|
+
run: (params?: any) => Promise<void>;
|
|
10
|
+
data: ResultModal;
|
|
11
|
+
};
|
|
6
12
|
export declare const useCuRef: ({ actionRef, editableFormRef }: HEditTableProps) => {
|
|
7
13
|
cuActionRef: MutableRefObject<ActionType>;
|
|
8
14
|
cuEditableFormRef: MutableRefObject<EditableFormInstance>;
|
|
9
15
|
};
|
|
10
|
-
|
|
16
|
+
interface ColProps extends HEditTableProps {
|
|
17
|
+
reload: VoidFunction;
|
|
18
|
+
}
|
|
19
|
+
export declare const useColsMk: ({ configData, reload }: ColProps) => (import("@ant-design/pro-table").ProColumnType<any, "text"> | {
|
|
11
20
|
render: (dom: any, entity: any, index: any, action: any, schema: any) => any;
|
|
12
21
|
children: import("@ant-design/pro-table").ProColumns<any, "text">[];
|
|
13
22
|
key?: import("react").Key | undefined;
|
|
@@ -1555,3 +1564,4 @@ export declare const useColsMk: ({ configData }: HEditTableProps) => (import("@a
|
|
|
1555
1564
|
} | undefined) | undefined;
|
|
1556
1565
|
fieldProps?: any;
|
|
1557
1566
|
})[] | undefined;
|
|
1567
|
+
export {};
|
package/es/EditTable/hooks.js
CHANGED
|
@@ -9,11 +9,12 @@ import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/obje
|
|
|
9
9
|
import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
|
|
10
10
|
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
11
11
|
import _asyncToGenerator from '@babel/runtime-corejs3/helpers/asyncToGenerator';
|
|
12
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
12
13
|
import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
|
|
13
14
|
import _Array$isArray from '@babel/runtime-corejs3/core-js-stable/array/is-array';
|
|
14
15
|
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
15
16
|
import { useRequest } from 'ahooks';
|
|
16
|
-
import { useMemo, useRef } from 'react';
|
|
17
|
+
import { useState, useMemo, useEffect, useRef } from 'react';
|
|
17
18
|
import config from '../render/config.js';
|
|
18
19
|
|
|
19
20
|
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; }
|
|
@@ -22,7 +23,15 @@ var useListRequest = function useListRequest(_ref) {
|
|
|
22
23
|
var request = _ref.request,
|
|
23
24
|
dataSource = _ref.dataSource,
|
|
24
25
|
manual = _ref.manual;
|
|
25
|
-
var
|
|
26
|
+
var _useState = useState({
|
|
27
|
+
records: [],
|
|
28
|
+
total: "0",
|
|
29
|
+
size: "10",
|
|
30
|
+
current: "1"
|
|
31
|
+
}),
|
|
32
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
+
tableDataSource = _useState2[0],
|
|
34
|
+
setTableDataSource = _useState2[1];
|
|
26
35
|
var saveParams = useMemo(function () {
|
|
27
36
|
return {
|
|
28
37
|
params: {
|
|
@@ -31,38 +40,60 @@ var useListRequest = function useListRequest(_ref) {
|
|
|
31
40
|
}
|
|
32
41
|
};
|
|
33
42
|
}, []);
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
43
|
+
var _useRequest = useRequest( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
44
|
+
var params,
|
|
45
|
+
newParams,
|
|
46
|
+
result,
|
|
47
|
+
_args = arguments;
|
|
48
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
49
|
+
while (1) switch (_context.prev = _context.next) {
|
|
50
|
+
case 0:
|
|
51
|
+
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
52
|
+
newParams = _objectSpread(_objectSpread({}, saveParams.params), params);
|
|
53
|
+
saveParams.params = newParams;
|
|
54
|
+
if (!request) {
|
|
55
|
+
_context.next = 9;
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
_context.next = 6;
|
|
59
|
+
return request(newParams);
|
|
60
|
+
case 6:
|
|
61
|
+
result = _context.sent;
|
|
62
|
+
setTableDataSource(result);
|
|
63
|
+
return _context.abrupt("return");
|
|
64
|
+
case 9:
|
|
65
|
+
if (!_Array$isArray(dataSource)) {
|
|
66
|
+
_context.next = 12;
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
setTableDataSource(_objectSpread(_objectSpread({}, tableDataSource), {}, {
|
|
70
|
+
records: dataSource
|
|
71
|
+
}));
|
|
72
|
+
return _context.abrupt("return");
|
|
73
|
+
case 12:
|
|
74
|
+
return _context.abrupt("return", setTableDataSource(dataSource || tableDataSource));
|
|
75
|
+
case 13:
|
|
76
|
+
case "end":
|
|
77
|
+
return _context.stop();
|
|
78
|
+
}
|
|
79
|
+
}, _callee);
|
|
80
|
+
})), {
|
|
81
|
+
manual: true
|
|
82
|
+
}),
|
|
83
|
+
loading = _useRequest.loading,
|
|
84
|
+
error = _useRequest.error,
|
|
85
|
+
run = _useRequest.run;
|
|
86
|
+
useEffect(function () {
|
|
87
|
+
if (!manual) {
|
|
88
|
+
run();
|
|
89
|
+
}
|
|
90
|
+
}, [dataSource]);
|
|
91
|
+
return {
|
|
92
|
+
loading: loading,
|
|
93
|
+
error: error,
|
|
94
|
+
run: run,
|
|
95
|
+
data: tableDataSource
|
|
96
|
+
};
|
|
66
97
|
};
|
|
67
98
|
var useCuRef = function useCuRef(_ref3) {
|
|
68
99
|
var actionRef = _ref3.actionRef,
|
|
@@ -77,23 +108,35 @@ var useCuRef = function useCuRef(_ref3) {
|
|
|
77
108
|
};
|
|
78
109
|
};
|
|
79
110
|
var useColsMk = function useColsMk(_ref4) {
|
|
80
|
-
var configData = _ref4.configData
|
|
111
|
+
var configData = _ref4.configData,
|
|
112
|
+
reload = _ref4.reload;
|
|
81
113
|
return configData === null || configData === void 0 ? void 0 : _mapInstanceProperty(configData).call(configData, function (item) {
|
|
82
114
|
var valueType = item.valueType,
|
|
83
115
|
_render = item.render;
|
|
84
116
|
var configType = valueType;
|
|
85
|
-
if (
|
|
86
|
-
return item
|
|
117
|
+
if (config[configType]) {
|
|
118
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
119
|
+
render: function render(dom, entity, index, action, schema) {
|
|
120
|
+
var node = config[configType](item, entity, index);
|
|
121
|
+
if (_render) {
|
|
122
|
+
return _render(node, entity, index, _objectSpread(_objectSpread({}, action), {}, {
|
|
123
|
+
reload: reload
|
|
124
|
+
}), schema);
|
|
125
|
+
}
|
|
126
|
+
return node;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
87
129
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
130
|
+
if (_render) {
|
|
131
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
132
|
+
render: function render(dom, entity, index, action, schema) {
|
|
133
|
+
return _render(dom, entity, index, _objectSpread(_objectSpread({}, action), {}, {
|
|
134
|
+
reload: reload
|
|
135
|
+
}), schema);
|
|
93
136
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
return item;
|
|
97
140
|
});
|
|
98
141
|
};
|
|
99
142
|
|
package/es/EditTable/index.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import _asyncToGenerator from '@babel/runtime-corejs3/helpers/asyncToGenerator';
|
|
3
|
-
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
4
|
-
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
5
|
-
import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
|
|
6
|
-
import _Array$isArray from '@babel/runtime-corejs3/core-js-stable/array/is-array';
|
|
7
2
|
import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
8
3
|
import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
9
4
|
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
@@ -12,6 +7,10 @@ import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/inst
|
|
|
12
7
|
import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
|
|
13
8
|
import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/object/define-properties';
|
|
14
9
|
import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
|
|
10
|
+
import _asyncToGenerator from '@babel/runtime-corejs3/helpers/asyncToGenerator';
|
|
11
|
+
import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
12
|
+
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
13
|
+
import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
|
|
15
14
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
16
15
|
import { EditableProTable } from '@ant-design/pro-table';
|
|
17
16
|
import { useClassName } from '../hooks/index.js';
|
|
@@ -66,8 +65,6 @@ var EditTable = (function (_ref) {
|
|
|
66
65
|
tableEmptyRender = _useHTableConfigConte2 === void 0 ? emptyDefaultRender : _useHTableConfigConte2,
|
|
67
66
|
_useHTableConfigConte3 = _useHTableConfigConte.errorRender,
|
|
68
67
|
tableErrorRender = _useHTableConfigConte3 === void 0 ? errorDefaultRender : _useHTableConfigConte3;
|
|
69
|
-
var isLocalData = _Array$isArray(data);
|
|
70
|
-
var values = isLocalData ? data : data === null || data === void 0 ? void 0 : data.records;
|
|
71
68
|
var _useCuRef = useCuRef({
|
|
72
69
|
actionRef: actionRef,
|
|
73
70
|
editableFormRef: editableFormRef
|
|
@@ -75,7 +72,8 @@ var EditTable = (function (_ref) {
|
|
|
75
72
|
cuActionRef = _useCuRef.cuActionRef,
|
|
76
73
|
cuEditableFormRef = _useCuRef.cuEditableFormRef;
|
|
77
74
|
var columns = useColsMk({
|
|
78
|
-
configData: configData
|
|
75
|
+
configData: configData,
|
|
76
|
+
reload: run
|
|
79
77
|
});
|
|
80
78
|
return jsxs("div", {
|
|
81
79
|
className: tableBody,
|
|
@@ -94,10 +92,8 @@ var EditTable = (function (_ref) {
|
|
|
94
92
|
loading: loading,
|
|
95
93
|
rowKey: rowKey,
|
|
96
94
|
editableFormRef: cuEditableFormRef,
|
|
97
|
-
manualRequest: true,
|
|
98
|
-
request: run,
|
|
99
95
|
actionRef: cuActionRef,
|
|
100
|
-
value:
|
|
96
|
+
value: data === null || data === void 0 ? void 0 : data.records,
|
|
101
97
|
recordCreatorProps: _objectSpread({
|
|
102
98
|
position: "bottom",
|
|
103
99
|
record: function record() {
|
|
@@ -169,8 +165,8 @@ var EditTable = (function (_ref) {
|
|
|
169
165
|
}()
|
|
170
166
|
}, editable)
|
|
171
167
|
}, props))
|
|
172
|
-
}), jsx(HTablePagination, _objectSpread(_objectSpread({
|
|
173
|
-
data:
|
|
168
|
+
}), pagination === false ? null : jsx(HTablePagination, _objectSpread(_objectSpread({
|
|
169
|
+
data: data
|
|
174
170
|
}, pagination), {}, {
|
|
175
171
|
onChange: function onChange(page, pageSize) {
|
|
176
172
|
run({
|
package/es/EditTable/modal.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface HEditTableProps<T = any> extends Omit<EditableProTableProps<T,
|
|
|
9
9
|
recordCreatorProps?: Partial<EditableProTableProps<T, ParamsType>["recordCreatorProps"]>;
|
|
10
10
|
dataSource?: any[];
|
|
11
11
|
request?: (params: Record<string, any>) => Promise<T>;
|
|
12
|
-
pagination?: IPaginationProps;
|
|
12
|
+
pagination?: IPaginationProps | false;
|
|
13
13
|
manual?: boolean;
|
|
14
14
|
emptyRender?: EmptyPageRender;
|
|
15
15
|
errorRender?: ErrorPageRender;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { IProps } from "
|
|
3
|
-
import type { ConfigDataModal } from "
|
|
4
|
-
export declare const
|
|
2
|
+
import type { IProps } from "../Options/modal";
|
|
3
|
+
import type { ConfigDataModal } from "../../modal";
|
|
4
|
+
export declare const useTreeValue: ({ columns, colStatusValue }: Pick<IProps, "colStatusValue" | "columns">) => {
|
|
5
|
+
checkKeys: string[];
|
|
6
|
+
cols: ConfigDataModal;
|
|
7
|
+
};
|
|
5
8
|
interface UseContentTreeModal {
|
|
6
9
|
columns: ConfigDataModal;
|
|
7
10
|
matchKey?: "right" | "left";
|
|
@@ -1,45 +1,72 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
+
import _toConsumableArray from '@babel/runtime-corejs3/helpers/toConsumableArray';
|
|
3
|
+
import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
2
4
|
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/for-each';
|
|
5
|
+
import _spliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/splice';
|
|
6
|
+
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
3
7
|
import _indexOfInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/index-of';
|
|
4
8
|
import { jsx } from 'react/jsx-runtime';
|
|
5
9
|
import { useMemo } from 'react';
|
|
6
10
|
import { getItemValue } from './utils.js';
|
|
7
11
|
import { useClassName } from '../../hooks/index.js';
|
|
8
12
|
|
|
9
|
-
var
|
|
13
|
+
var useTreeValue = function useTreeValue(_ref) {
|
|
10
14
|
var columns = _ref.columns,
|
|
11
15
|
colStatusValue = _ref.colStatusValue;
|
|
12
16
|
return useMemo(function () {
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
var _context2;
|
|
18
|
+
var checkKeys = [];
|
|
19
|
+
var newCols = _filterInstanceProperty(columns).call(columns, function (_ref2) {
|
|
20
|
+
var dataIndex = _ref2.dataIndex,
|
|
21
|
+
hideInTable = _ref2.hideInTable;
|
|
22
|
+
return !hideInTable && dataIndex;
|
|
23
|
+
});
|
|
24
|
+
var sortCols = [];
|
|
25
|
+
var tmpCols = [];
|
|
26
|
+
var tmpLen = 0;
|
|
27
|
+
_forEachInstanceProperty(newCols).call(newCols, function (value) {
|
|
28
|
+
var dataIndex = value.dataIndex;
|
|
20
29
|
var dataIndexStr = dataIndex.toString();
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
show =
|
|
24
|
-
|
|
25
|
-
|
|
30
|
+
var _ref3 = colStatusValue[dataIndexStr] || {},
|
|
31
|
+
order = _ref3.order,
|
|
32
|
+
_ref3$show = _ref3.show,
|
|
33
|
+
show = _ref3$show === void 0 ? true : _ref3$show;
|
|
34
|
+
var orderStr = order === null || order === void 0 ? void 0 : order.toString();
|
|
35
|
+
if (!orderStr) {
|
|
36
|
+
tmpCols.push(value);
|
|
37
|
+
}
|
|
38
|
+
if (orderStr) {
|
|
39
|
+
var cuOrder = order + tmpLen;
|
|
40
|
+
sortCols[cuOrder] = value;
|
|
41
|
+
}
|
|
42
|
+
if (order === 0) {
|
|
43
|
+
var _context;
|
|
44
|
+
_spliceInstanceProperty(sortCols).apply(sortCols, _concatInstanceProperty(_context = [0, 0]).call(_context, _toConsumableArray(tmpCols)));
|
|
45
|
+
tmpLen = tmpCols.length;
|
|
46
|
+
tmpCols = [];
|
|
47
|
+
}
|
|
48
|
+
if (show) {
|
|
49
|
+
checkKeys.push(dataIndexStr);
|
|
26
50
|
}
|
|
27
|
-
keys.push(dataIndexStr);
|
|
28
51
|
});
|
|
29
|
-
|
|
52
|
+
_spliceInstanceProperty(sortCols).apply(sortCols, _concatInstanceProperty(_context2 = [tmpLen + 1, 0]).call(_context2, _toConsumableArray(tmpCols)));
|
|
53
|
+
return {
|
|
54
|
+
checkKeys: checkKeys,
|
|
55
|
+
cols: sortCols
|
|
56
|
+
};
|
|
30
57
|
}, [colStatusValue, columns]);
|
|
31
58
|
};
|
|
32
|
-
var useContentTree = function useContentTree(
|
|
33
|
-
var columns =
|
|
34
|
-
matchKey =
|
|
59
|
+
var useContentTree = function useContentTree(_ref4) {
|
|
60
|
+
var columns = _ref4.columns,
|
|
61
|
+
matchKey = _ref4.matchKey;
|
|
35
62
|
var titleClass = useClassName("hw-table-body-option-setting-content-title");
|
|
36
63
|
return useMemo(function () {
|
|
37
64
|
var treeData = [];
|
|
38
|
-
_forEachInstanceProperty(columns).call(columns, function (
|
|
39
|
-
var dataIndex =
|
|
40
|
-
title =
|
|
41
|
-
titleStr =
|
|
42
|
-
fixed =
|
|
65
|
+
_forEachInstanceProperty(columns).call(columns, function (_ref5) {
|
|
66
|
+
var dataIndex = _ref5.dataIndex,
|
|
67
|
+
title = _ref5.title,
|
|
68
|
+
titleStr = _ref5.titleStr,
|
|
69
|
+
fixed = _ref5.fixed;
|
|
43
70
|
if (!dataIndex) {
|
|
44
71
|
return;
|
|
45
72
|
}
|
|
@@ -62,13 +89,13 @@ var useContentTree = function useContentTree(_ref3) {
|
|
|
62
89
|
return treeData;
|
|
63
90
|
}, [columns]);
|
|
64
91
|
};
|
|
65
|
-
var useTreeKeys = function useTreeKeys(
|
|
66
|
-
var treeData =
|
|
67
|
-
checkKeys =
|
|
92
|
+
var useTreeKeys = function useTreeKeys(_ref6) {
|
|
93
|
+
var treeData = _ref6.treeData,
|
|
94
|
+
checkKeys = _ref6.checkKeys;
|
|
68
95
|
return useMemo(function () {
|
|
69
96
|
var newKeys = [];
|
|
70
|
-
_forEachInstanceProperty(treeData).call(treeData, function (
|
|
71
|
-
var key =
|
|
97
|
+
_forEachInstanceProperty(treeData).call(treeData, function (_ref7) {
|
|
98
|
+
var key = _ref7.key;
|
|
72
99
|
var index = _indexOfInstanceProperty(checkKeys).call(checkKeys, key);
|
|
73
100
|
if (index !== -1) {
|
|
74
101
|
newKeys.push(key);
|
|
@@ -78,5 +105,5 @@ var useTreeKeys = function useTreeKeys(_ref5) {
|
|
|
78
105
|
}, [treeData, checkKeys]);
|
|
79
106
|
};
|
|
80
107
|
|
|
81
|
-
export {
|
|
108
|
+
export { useContentTree, useTreeKeys, useTreeValue };
|
|
82
109
|
// powered by hdj
|
|
@@ -6,7 +6,7 @@ import { ReloadOutlined, ColumnHeightOutlined, SettingOutlined } from '@ant-desi
|
|
|
6
6
|
import { useRef } from 'react';
|
|
7
7
|
import { ColsSettingContent } from './Content.js';
|
|
8
8
|
import { Title } from './Title.js';
|
|
9
|
-
import {
|
|
9
|
+
import { useTreeValue } from './hooks.js';
|
|
10
10
|
|
|
11
11
|
var Options = (function (_ref) {
|
|
12
12
|
var reload = _ref.reload,
|
|
@@ -23,10 +23,12 @@ var Options = (function (_ref) {
|
|
|
23
23
|
onDrop = _ref.onDrop;
|
|
24
24
|
var pointer = useClassName(["hw-table-pointer", "hw-table-body-option-icon"]);
|
|
25
25
|
var ref = useRef(null);
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
var _useTreeValue = useTreeValue({
|
|
27
|
+
columns: columns,
|
|
28
|
+
colStatusValue: colStatusValue
|
|
29
|
+
}),
|
|
30
|
+
checkKeys = _useTreeValue.checkKeys,
|
|
31
|
+
cols = _useTreeValue.cols;
|
|
30
32
|
var SizeItem = function SizeItem() {
|
|
31
33
|
var MenuComponent = Menu;
|
|
32
34
|
var MenuItem = Menu.Item;
|
|
@@ -83,7 +85,7 @@ var Options = (function (_ref) {
|
|
|
83
85
|
})
|
|
84
86
|
}), jsx(Popover, {
|
|
85
87
|
content: jsx(ColsSettingContent, {
|
|
86
|
-
columns:
|
|
88
|
+
columns: cols,
|
|
87
89
|
checkKeys: checkKeys,
|
|
88
90
|
onCheck: onChange,
|
|
89
91
|
onDrop: onDrop
|
|
@@ -5,7 +5,7 @@ export declare const getItemValue: (data: ConfigItemModal) => {
|
|
|
5
5
|
labelAlign?: import("@hw-component/form/es/Form/modal").LabelAlignModal | undefined;
|
|
6
6
|
label?: React.ReactNode | import("@hw-component/form/es/Form/modal").HelperModal;
|
|
7
7
|
hidden?: boolean | import("@hw-component/form/es/Form/modal").HideModal | undefined;
|
|
8
|
-
children?: React.
|
|
8
|
+
children?: ((string | number | boolean | {} | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactNodeArray | React.ReactPortal | ((form: import("rc-field-form").FormInstance<any>) => React.ReactNode) | null) & ConfigItemModal[]) | undefined;
|
|
9
9
|
dependencies?: import("rc-field-form/lib/interface").NamePath[] | undefined;
|
|
10
10
|
getValueFromEvent?: ((...args: import("rc-field-form/lib/interface").EventArgs) => any) | undefined;
|
|
11
11
|
normalize?: ((value: any, prevValue: any, allValues: import("rc-field-form/lib/interface").Store) => any) | undefined;
|
|
@@ -802,7 +802,7 @@ export declare const getItemValue: (data: ConfigItemModal) => {
|
|
|
802
802
|
width?: number | undefined;
|
|
803
803
|
} | undefined) | undefined;
|
|
804
804
|
fieldProps?: any;
|
|
805
|
-
childrenDataIndex?:
|
|
805
|
+
childrenDataIndex?: ConfigItemModal[] | string[] | undefined;
|
|
806
806
|
title: any;
|
|
807
807
|
dataIndex: ((string | number | (string | number)[]) & import("rc-table/lib/interface").DataIndex) | undefined;
|
|
808
808
|
};
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import type { ConfigDataModal, HTableProps } from "../../modal";
|
|
1
|
+
import type { ConfigDataModal } from "../../modal";
|
|
3
2
|
import type { ColumnsState } from "@ant-design/pro-table/es/container";
|
|
4
3
|
import type { ColumnsStateType } from "@ant-design/pro-table/es/typing";
|
|
5
|
-
export declare const useCols: ({ configData, rowSelection, table, bordered, configItemRender, }: HTableProps) => {
|
|
6
|
-
cols: ConfigDataModal;
|
|
7
|
-
setCols: import("react").Dispatch<import("react").SetStateAction<ConfigDataModal>>;
|
|
8
|
-
resetCols: () => void;
|
|
9
|
-
};
|
|
10
4
|
interface useColumnsStateTypeModal {
|
|
11
5
|
columnsState?: ColumnsStateType;
|
|
12
6
|
columns: ConfigDataModal;
|
|
@@ -16,6 +10,7 @@ export declare const useColumnsStateType: ({ columnsState, columns, }: useColumn
|
|
|
16
10
|
persistenceKey: string | undefined;
|
|
17
11
|
value: Record<string, ColumnsState> | undefined;
|
|
18
12
|
onChange: (keys: string[], notCheck: string[]) => void;
|
|
19
|
-
|
|
13
|
+
resetCol: () => void;
|
|
14
|
+
dropChange: (list: ConfigDataModal) => void;
|
|
20
15
|
};
|
|
21
16
|
export {};
|