@hw-component/table 1.10.0 → 1.10.1
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/DialogTable/Content.js +2 -2
- package/es/EditTable/index.js +3 -3
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/lib/EditTable/index.js +3 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +2 -2
- package/src/components/DialogTable/Content.tsx +2 -2
- package/src/components/EditTable/index.tsx +1 -1
- package/src/components/index.tsx +1 -1
- package/src/pages/EditTable/index.tsx +14 -12
- package/src/pages/ModalEditTable/index.tsx +14 -15
|
@@ -40,7 +40,7 @@ import '../HTableBody/Options/Title.js';
|
|
|
40
40
|
import '../HTableFooter/index.js';
|
|
41
41
|
import '../HTableHeader/Context.js';
|
|
42
42
|
import '../HTableHeader/RangePickerSearch.js';
|
|
43
|
-
import
|
|
43
|
+
import HEditTable from '../EditTable/index.js';
|
|
44
44
|
|
|
45
45
|
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; }
|
|
46
46
|
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; }
|
|
@@ -68,7 +68,7 @@ var EditTableContent = function EditTableContent(_ref2) {
|
|
|
68
68
|
request = _ref2.request,
|
|
69
69
|
contentRender = _ref2.contentRender,
|
|
70
70
|
dataSource = _ref2.dataSource;
|
|
71
|
-
var node = jsx(
|
|
71
|
+
var node = jsx(HEditTable, _objectSpread(_objectSpread({}, editTableProps), {}, {
|
|
72
72
|
configData: configData || [],
|
|
73
73
|
request: request,
|
|
74
74
|
pagination: {
|
package/es/EditTable/index.js
CHANGED
|
@@ -25,7 +25,7 @@ var _excluded = ["configData", "rowKey", "creatorButtonText", "recordCreatorProp
|
|
|
25
25
|
_excluded2 = ["index", "id"];
|
|
26
26
|
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; }
|
|
27
27
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28
|
-
var
|
|
28
|
+
var HEditTable = (function (_ref) {
|
|
29
29
|
var configData = _ref.configData,
|
|
30
30
|
_ref$rowKey = _ref.rowKey,
|
|
31
31
|
rowKey = _ref$rowKey === void 0 ? "id" : _ref$rowKey,
|
|
@@ -153,7 +153,7 @@ var EditTable = (function (_ref) {
|
|
|
153
153
|
id: id
|
|
154
154
|
}, oRow));
|
|
155
155
|
case 9:
|
|
156
|
-
(_cuEditableFormRef$cu3 = cuEditableFormRef.current) === null || _cuEditableFormRef$cu3 === void 0 || _cuEditableFormRef$cu3.resetFields([
|
|
156
|
+
(_cuEditableFormRef$cu3 = cuEditableFormRef.current) === null || _cuEditableFormRef$cu3 === void 0 || _cuEditableFormRef$cu3.resetFields([key]);
|
|
157
157
|
(_cuActionRef$current2 = cuActionRef.current) === null || _cuActionRef$current2 === void 0 || _cuActionRef$current2.reload();
|
|
158
158
|
case 11:
|
|
159
159
|
case "end":
|
|
@@ -181,5 +181,5 @@ var EditTable = (function (_ref) {
|
|
|
181
181
|
});
|
|
182
182
|
});
|
|
183
183
|
|
|
184
|
-
export {
|
|
184
|
+
export { HEditTable as default };
|
|
185
185
|
// powered by hdj
|
package/es/index.d.ts
CHANGED
|
@@ -12,6 +12,6 @@ export { default as HModalTable } from "./DialogTable/ModalTable";
|
|
|
12
12
|
export { useHDialogTable } from "./DialogTable/hooks";
|
|
13
13
|
export { default as HDwTable } from "./DialogTable/DwTable";
|
|
14
14
|
export { DefaultSubComponent as HTableHeaderSubBtn } from "./HTableHeader/defaultSubComponent";
|
|
15
|
-
export { default as
|
|
15
|
+
export { default as HEditTable } from "./EditTable";
|
|
16
16
|
export { default as HModalEditTable } from "./DialogTable/ModalEditTable";
|
|
17
17
|
export { default as HDwEditTable } from "./DialogTable/DwEditTable";
|
package/es/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export { default as HModalTable } from './DialogTable/ModalTable.js';
|
|
|
11
11
|
export { useHDialogTable } from './DialogTable/hooks.js';
|
|
12
12
|
export { default as HDwTable } from './DialogTable/DwTable.js';
|
|
13
13
|
export { DefaultSubComponent as HTableHeaderSubBtn } from './HTableHeader/defaultSubComponent.js';
|
|
14
|
-
export { default as
|
|
14
|
+
export { default as HEditTable } from './EditTable/index.js';
|
|
15
15
|
export { default as HModalEditTable } from './DialogTable/ModalEditTable.js';
|
|
16
16
|
export { default as HDwEditTable } from './DialogTable/DwEditTable.js';
|
|
17
17
|
// powered by hdj
|
package/lib/EditTable/index.js
CHANGED
|
@@ -28,7 +28,7 @@ var _excluded = ["configData", "rowKey", "creatorButtonText", "recordCreatorProp
|
|
|
28
28
|
_excluded2 = ["index", "id"];
|
|
29
29
|
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; }
|
|
30
30
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
31
|
-
var
|
|
31
|
+
var HEditTable = (function (_ref) {
|
|
32
32
|
var configData = _ref.configData,
|
|
33
33
|
_ref$rowKey = _ref.rowKey,
|
|
34
34
|
rowKey = _ref$rowKey === void 0 ? "id" : _ref$rowKey,
|
|
@@ -156,7 +156,7 @@ var EditTable = (function (_ref) {
|
|
|
156
156
|
id: id
|
|
157
157
|
}, oRow));
|
|
158
158
|
case 9:
|
|
159
|
-
(_cuEditableFormRef$cu3 = cuEditableFormRef.current) === null || _cuEditableFormRef$cu3 === void 0 || _cuEditableFormRef$cu3.resetFields([
|
|
159
|
+
(_cuEditableFormRef$cu3 = cuEditableFormRef.current) === null || _cuEditableFormRef$cu3 === void 0 || _cuEditableFormRef$cu3.resetFields([key]);
|
|
160
160
|
(_cuActionRef$current2 = cuActionRef.current) === null || _cuActionRef$current2 === void 0 || _cuActionRef$current2.reload();
|
|
161
161
|
case 11:
|
|
162
162
|
case "end":
|
|
@@ -184,5 +184,5 @@ var EditTable = (function (_ref) {
|
|
|
184
184
|
});
|
|
185
185
|
});
|
|
186
186
|
|
|
187
|
-
exports.default =
|
|
187
|
+
exports.default = HEditTable;
|
|
188
188
|
// powered by h
|
package/lib/index.d.ts
CHANGED
|
@@ -12,6 +12,6 @@ export { default as HModalTable } from "./DialogTable/ModalTable";
|
|
|
12
12
|
export { useHDialogTable } from "./DialogTable/hooks";
|
|
13
13
|
export { default as HDwTable } from "./DialogTable/DwTable";
|
|
14
14
|
export { DefaultSubComponent as HTableHeaderSubBtn } from "./HTableHeader/defaultSubComponent";
|
|
15
|
-
export { default as
|
|
15
|
+
export { default as HEditTable } from "./EditTable";
|
|
16
16
|
export { default as HModalEditTable } from "./DialogTable/ModalEditTable";
|
|
17
17
|
export { default as HDwEditTable } from "./DialogTable/DwEditTable";
|
package/lib/index.js
CHANGED
|
@@ -30,7 +30,7 @@ exports.HModalTable = ModalTable.default;
|
|
|
30
30
|
exports.useHDialogTable = hooks.useHDialogTable;
|
|
31
31
|
exports.HDwTable = DwTable.default;
|
|
32
32
|
exports.HTableHeaderSubBtn = defaultSubComponent.DefaultSubComponent;
|
|
33
|
-
exports.
|
|
33
|
+
exports.HEditTable = index$4.default;
|
|
34
34
|
exports.HModalEditTable = ModalEditTable.default;
|
|
35
35
|
exports.HDwEditTable = DwEditTable.default;
|
|
36
36
|
// powered by h
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hw-component/table",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.1",
|
|
4
4
|
"description": "基于antd二次开发table组件",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"table"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@typescript-eslint/eslint-plugin": "^5.59.7",
|
|
54
54
|
"@umijs/fabric": "^2.14.1",
|
|
55
55
|
"ahooks": "2.10.9",
|
|
56
|
-
"antd": "4.
|
|
56
|
+
"antd": "4.22.8",
|
|
57
57
|
"autoprefixer": "^10.4.14",
|
|
58
58
|
"babel-loader": "^9.1.2",
|
|
59
59
|
"css-loader": "^6.7.4",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Table from "@/components/Table";
|
|
2
2
|
import type { ModalTableProps } from "../modal";
|
|
3
|
-
import {
|
|
3
|
+
import { HEditTable } from "@/components";
|
|
4
4
|
import { ProColumns } from "@ant-design/pro-table/lib/typing";
|
|
5
5
|
|
|
6
6
|
export const TableContent = ({
|
|
@@ -32,7 +32,7 @@ export const EditTableContent = ({
|
|
|
32
32
|
dataSource,
|
|
33
33
|
}: ModalTableProps<ProColumns[]>) => {
|
|
34
34
|
const node = (
|
|
35
|
-
<
|
|
35
|
+
<HEditTable
|
|
36
36
|
{...editTableProps}
|
|
37
37
|
configData={configData || []}
|
|
38
38
|
request={request}
|
package/src/components/index.tsx
CHANGED
|
@@ -12,6 +12,6 @@ export { default as HModalTable } from "./DialogTable/ModalTable";
|
|
|
12
12
|
export { useHDialogTable } from "./DialogTable/hooks";
|
|
13
13
|
export { default as HDwTable } from "./DialogTable/DwTable";
|
|
14
14
|
export { DefaultSubComponent as HTableHeaderSubBtn } from "./HTableHeader/defaultSubComponent";
|
|
15
|
-
export { default as
|
|
15
|
+
export { default as HEditTable } from "./EditTable";
|
|
16
16
|
export { default as HModalEditTable } from "./DialogTable/ModalEditTable";
|
|
17
17
|
export { default as HDwEditTable } from "./DialogTable/DwEditTable";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HEditTable } from "@/components";
|
|
2
2
|
import { useRef, useState } from "react";
|
|
3
3
|
import type { ActionType } from "@ant-design/pro-table";
|
|
4
4
|
|
|
@@ -29,22 +29,25 @@ export default () => {
|
|
|
29
29
|
const defaultActionRef = useRef<ActionType>();
|
|
30
30
|
const [cuData, setCuData] = useState(dataSource);
|
|
31
31
|
return (
|
|
32
|
-
<
|
|
32
|
+
<HEditTable
|
|
33
33
|
actionRef={defaultActionRef}
|
|
34
34
|
onAdd={async (data) => {
|
|
35
35
|
const newData = [...cuData];
|
|
36
|
-
newData.push({
|
|
37
|
-
id: newData.length + 1,
|
|
38
|
-
...data,
|
|
39
|
-
});
|
|
40
|
-
setCuData(newData);
|
|
41
36
|
}}
|
|
42
37
|
onEdit={async (data) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
|
|
39
|
+
}}
|
|
40
|
+
request={async ()=>{
|
|
41
|
+
return {
|
|
42
|
+
records:[{
|
|
43
|
+
id:"213213",
|
|
44
|
+
title:"100"
|
|
45
|
+
}],
|
|
46
|
+
current:"1",
|
|
47
|
+
size:"10",
|
|
48
|
+
total:"10"
|
|
49
|
+
}
|
|
46
50
|
}}
|
|
47
|
-
dataSource={cuData}
|
|
48
51
|
configData={[
|
|
49
52
|
{ title: "标题", dataIndex: "title" },
|
|
50
53
|
{ title: "标题2", dataIndex: "time", valueType: "date" },
|
|
@@ -57,7 +60,6 @@ export default () => {
|
|
|
57
60
|
key="editable"
|
|
58
61
|
type={"link"}
|
|
59
62
|
onClick={() => {
|
|
60
|
-
console.log(action);
|
|
61
63
|
action?.startEditable?.(record.id);
|
|
62
64
|
}}
|
|
63
65
|
>
|
|
@@ -40,28 +40,27 @@ export default () => {
|
|
|
40
40
|
</div>
|
|
41
41
|
<HDwEditTable
|
|
42
42
|
title="编辑"
|
|
43
|
-
request={async ()
|
|
43
|
+
request={async ()=>{
|
|
44
44
|
return {
|
|
45
|
-
records:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
records:[{
|
|
46
|
+
id:"213213",
|
|
47
|
+
title:"100"
|
|
48
|
+
}],
|
|
49
|
+
current:"1",
|
|
50
|
+
size:"10",
|
|
51
|
+
total:"10"
|
|
52
|
+
}
|
|
50
53
|
}}
|
|
51
54
|
editTableProps={{
|
|
52
55
|
onAdd: async (data) => {
|
|
53
|
-
|
|
54
|
-
newData.push({
|
|
55
|
-
id: newData.length + 1,
|
|
56
|
-
...data,
|
|
57
|
-
});
|
|
58
|
-
setCuData(newData);
|
|
56
|
+
|
|
59
57
|
},
|
|
60
58
|
onEdit: async (data) => {
|
|
61
|
-
|
|
62
|
-
cuData[index] = data;
|
|
63
|
-
setCuData([...cuData]);
|
|
59
|
+
|
|
64
60
|
},
|
|
61
|
+
defaultRecordValue:{
|
|
62
|
+
title:"21312"
|
|
63
|
+
}
|
|
65
64
|
}}
|
|
66
65
|
dialogTable={dialogTable}
|
|
67
66
|
configData={[
|