@hw-component/table 1.10.50 → 1.10.51
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 -1
- package/es/EditTable/index.d.ts +1 -1
- package/es/EditTable/index.js +4 -2
- package/es/EditTable/modal.d.ts +3 -3
- package/es/render/Text.d.ts +0 -1
- package/lib/DialogTable/Content.js +2 -1
- package/lib/EditTable/index.d.ts +1 -1
- package/lib/EditTable/index.js +4 -2
- package/lib/EditTable/modal.d.ts +3 -3
- package/lib/render/Text.d.ts +0 -1
- package/package.json +1 -1
- package/src/components/DialogTable/Content.tsx +1 -0
- package/src/components/EditTable/index.tsx +2 -1
- package/src/components/EditTable/modal.ts +3 -3
- package/src/pages/EditTable/index.tsx +1 -1
- package/src/pages/ModalEditTable/index.tsx +2 -2
|
@@ -55,7 +55,8 @@ var EditTableContent = function EditTableContent(_ref2) {
|
|
|
55
55
|
configData: configData || [],
|
|
56
56
|
request: request,
|
|
57
57
|
pagination: cuPagination,
|
|
58
|
-
dataSource: dataSource
|
|
58
|
+
dataSource: dataSource,
|
|
59
|
+
manualRequest: false
|
|
59
60
|
}));
|
|
60
61
|
return jsx(Fragment, {
|
|
61
62
|
children: contentRender ? contentRender(node) : node
|
package/es/EditTable/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { HEditTableProps } from "./modal";
|
|
3
|
-
declare const _default: ({ configData, rowKey, creatorButtonText, recordCreatorProps, defaultRecordValue, pagination, editable, dataSource, request, manual, emptyRender, errorRender, onAdd, onEdit, style, table, ...props }: HEditTableProps) => JSX.Element;
|
|
3
|
+
declare const _default: ({ configData, rowKey, creatorButtonText, recordCreatorProps, defaultRecordValue, pagination, editable, dataSource, request, manual, emptyRender, errorRender, onAdd, onEdit, style, table, manualRequest, ...props }: HEditTableProps) => JSX.Element;
|
|
4
4
|
export default _default;
|
package/es/EditTable/index.js
CHANGED
|
@@ -22,7 +22,7 @@ import { useHTableConfigContext } from '../TableConfig.js';
|
|
|
22
22
|
import { useCuEditTable, useListRequest, useEditTableInit, useColsMk } from './hooks.js';
|
|
23
23
|
import { useRef } from 'react';
|
|
24
24
|
|
|
25
|
-
var _excluded = ["configData", "rowKey", "creatorButtonText", "recordCreatorProps", "defaultRecordValue", "pagination", "editable", "dataSource", "request", "manual", "emptyRender", "errorRender", "onAdd", "onEdit", "style", "table"],
|
|
25
|
+
var _excluded = ["configData", "rowKey", "creatorButtonText", "recordCreatorProps", "defaultRecordValue", "pagination", "editable", "dataSource", "request", "manual", "emptyRender", "errorRender", "onAdd", "onEdit", "style", "table", "manualRequest"],
|
|
26
26
|
_excluded2 = ["index", "id"];
|
|
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 _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; }
|
|
@@ -48,6 +48,8 @@ var EditTable = (function (_ref) {
|
|
|
48
48
|
onEdit = _ref.onEdit,
|
|
49
49
|
style = _ref.style,
|
|
50
50
|
table = _ref.table,
|
|
51
|
+
_ref$manualRequest = _ref.manualRequest,
|
|
52
|
+
manualRequest = _ref$manualRequest === void 0 ? true : _ref$manualRequest,
|
|
51
53
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
52
54
|
var cuTable = useCuEditTable({
|
|
53
55
|
table: table
|
|
@@ -102,7 +104,7 @@ var EditTable = (function (_ref) {
|
|
|
102
104
|
editableFormRef: defaultEditableFormRef,
|
|
103
105
|
actionRef: defaultActionRef,
|
|
104
106
|
value: data === null || data === void 0 ? void 0 : data.records,
|
|
105
|
-
manualRequest:
|
|
107
|
+
manualRequest: manualRequest,
|
|
106
108
|
request: function request(params, sorter) {
|
|
107
109
|
run({}, sorter);
|
|
108
110
|
return _Promise.resolve({});
|
package/es/EditTable/modal.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { EditableFormInstance, EditableProTableProps } from "@ant-design/pro-table/lib/components/EditableTable";
|
|
2
2
|
import { ParamsType } from "@ant-design/pro-provider";
|
|
3
3
|
import { IPaginationProps } from "../HTablePagination";
|
|
4
|
-
import { EmptyPageRender, ErrorPageRender } from "../modal";
|
|
4
|
+
import { EmptyPageRender, ErrorPageRender, ResultModal } from "../modal";
|
|
5
5
|
import { ActionType, ProColumns } from "@ant-design/pro-table/lib/typing";
|
|
6
6
|
export interface EditTableInstance {
|
|
7
7
|
editableForm: EditableFormInstance | {};
|
|
8
8
|
action: ActionType | {};
|
|
9
9
|
reload: () => void;
|
|
10
10
|
}
|
|
11
|
-
export interface HEditTableProps<T = any> extends Omit<EditableProTableProps<T, ParamsType>, "recordCreatorProps" | "request" | "pagination"> {
|
|
11
|
+
export interface HEditTableProps<T = any> extends Omit<EditableProTableProps<T, ParamsType>, "recordCreatorProps" | "request" | "pagination" | "dataSource"> {
|
|
12
12
|
creatorButtonText?: string;
|
|
13
13
|
defaultRecordValue?: T;
|
|
14
14
|
recordCreatorProps?: Partial<EditableProTableProps<T, ParamsType>["recordCreatorProps"]>;
|
|
15
|
-
dataSource?: any[];
|
|
15
|
+
dataSource?: ResultModal | any[];
|
|
16
16
|
request?: (params: Record<string, any>) => Promise<T>;
|
|
17
17
|
pagination?: IPaginationProps | false;
|
|
18
18
|
manual?: boolean;
|
package/es/render/Text.d.ts
CHANGED
|
@@ -56,7 +56,8 @@ var EditTableContent = function EditTableContent(_ref2) {
|
|
|
56
56
|
configData: configData || [],
|
|
57
57
|
request: request,
|
|
58
58
|
pagination: cuPagination,
|
|
59
|
-
dataSource: dataSource
|
|
59
|
+
dataSource: dataSource,
|
|
60
|
+
manualRequest: false
|
|
60
61
|
}));
|
|
61
62
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
62
63
|
children: contentRender ? contentRender(node) : node
|
package/lib/EditTable/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { HEditTableProps } from "./modal";
|
|
3
|
-
declare const _default: ({ configData, rowKey, creatorButtonText, recordCreatorProps, defaultRecordValue, pagination, editable, dataSource, request, manual, emptyRender, errorRender, onAdd, onEdit, style, table, ...props }: HEditTableProps) => JSX.Element;
|
|
3
|
+
declare const _default: ({ configData, rowKey, creatorButtonText, recordCreatorProps, defaultRecordValue, pagination, editable, dataSource, request, manual, emptyRender, errorRender, onAdd, onEdit, style, table, manualRequest, ...props }: HEditTableProps) => JSX.Element;
|
|
4
4
|
export default _default;
|
package/lib/EditTable/index.js
CHANGED
|
@@ -25,7 +25,7 @@ var TableConfig = require('../TableConfig.js');
|
|
|
25
25
|
var hooks = require('./hooks.js');
|
|
26
26
|
var React = require('react');
|
|
27
27
|
|
|
28
|
-
var _excluded = ["configData", "rowKey", "creatorButtonText", "recordCreatorProps", "defaultRecordValue", "pagination", "editable", "dataSource", "request", "manual", "emptyRender", "errorRender", "onAdd", "onEdit", "style", "table"],
|
|
28
|
+
var _excluded = ["configData", "rowKey", "creatorButtonText", "recordCreatorProps", "defaultRecordValue", "pagination", "editable", "dataSource", "request", "manual", "emptyRender", "errorRender", "onAdd", "onEdit", "style", "table", "manualRequest"],
|
|
29
29
|
_excluded2 = ["index", "id"];
|
|
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 _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; }
|
|
@@ -51,6 +51,8 @@ var EditTable = (function (_ref) {
|
|
|
51
51
|
onEdit = _ref.onEdit,
|
|
52
52
|
style = _ref.style,
|
|
53
53
|
table = _ref.table,
|
|
54
|
+
_ref$manualRequest = _ref.manualRequest,
|
|
55
|
+
manualRequest = _ref$manualRequest === void 0 ? true : _ref$manualRequest,
|
|
54
56
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
55
57
|
var cuTable = hooks.useCuEditTable({
|
|
56
58
|
table: table
|
|
@@ -105,7 +107,7 @@ var EditTable = (function (_ref) {
|
|
|
105
107
|
editableFormRef: defaultEditableFormRef,
|
|
106
108
|
actionRef: defaultActionRef,
|
|
107
109
|
value: data === null || data === void 0 ? void 0 : data.records,
|
|
108
|
-
manualRequest:
|
|
110
|
+
manualRequest: manualRequest,
|
|
109
111
|
request: function request(params, sorter) {
|
|
110
112
|
run({}, sorter);
|
|
111
113
|
return _Promise.resolve({});
|
package/lib/EditTable/modal.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { EditableFormInstance, EditableProTableProps } from "@ant-design/pro-table/lib/components/EditableTable";
|
|
2
2
|
import { ParamsType } from "@ant-design/pro-provider";
|
|
3
3
|
import { IPaginationProps } from "../HTablePagination";
|
|
4
|
-
import { EmptyPageRender, ErrorPageRender } from "../modal";
|
|
4
|
+
import { EmptyPageRender, ErrorPageRender, ResultModal } from "../modal";
|
|
5
5
|
import { ActionType, ProColumns } from "@ant-design/pro-table/lib/typing";
|
|
6
6
|
export interface EditTableInstance {
|
|
7
7
|
editableForm: EditableFormInstance | {};
|
|
8
8
|
action: ActionType | {};
|
|
9
9
|
reload: () => void;
|
|
10
10
|
}
|
|
11
|
-
export interface HEditTableProps<T = any> extends Omit<EditableProTableProps<T, ParamsType>, "recordCreatorProps" | "request" | "pagination"> {
|
|
11
|
+
export interface HEditTableProps<T = any> extends Omit<EditableProTableProps<T, ParamsType>, "recordCreatorProps" | "request" | "pagination" | "dataSource"> {
|
|
12
12
|
creatorButtonText?: string;
|
|
13
13
|
defaultRecordValue?: T;
|
|
14
14
|
recordCreatorProps?: Partial<EditableProTableProps<T, ParamsType>["recordCreatorProps"]>;
|
|
15
|
-
dataSource?: any[];
|
|
15
|
+
dataSource?: ResultModal | any[];
|
|
16
16
|
request?: (params: Record<string, any>) => Promise<T>;
|
|
17
17
|
pagination?: IPaginationProps | false;
|
|
18
18
|
manual?: boolean;
|
package/lib/render/Text.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -34,6 +34,7 @@ export default ({
|
|
|
34
34
|
onEdit,
|
|
35
35
|
style,
|
|
36
36
|
table,
|
|
37
|
+
manualRequest=true,
|
|
37
38
|
...props
|
|
38
39
|
}: HEditTableProps) => {
|
|
39
40
|
const cuTable = useCuEditTable({ table });
|
|
@@ -77,7 +78,7 @@ export default ({
|
|
|
77
78
|
editableFormRef={defaultEditableFormRef}
|
|
78
79
|
actionRef={defaultActionRef}
|
|
79
80
|
value={data?.records}
|
|
80
|
-
manualRequest
|
|
81
|
+
manualRequest={manualRequest}
|
|
81
82
|
request={(params, sorter) => {
|
|
82
83
|
run({}, sorter);
|
|
83
84
|
return Promise.resolve({});
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "@ant-design/pro-table/lib/components/EditableTable";
|
|
5
5
|
import { ParamsType } from "@ant-design/pro-provider";
|
|
6
6
|
import { IPaginationProps } from "../HTablePagination";
|
|
7
|
-
import {
|
|
7
|
+
import {EmptyPageRender, ErrorPageRender, ResultModal} from "../modal";
|
|
8
8
|
import { ActionType, ProColumns } from "@ant-design/pro-table/lib/typing";
|
|
9
9
|
|
|
10
10
|
export interface EditTableInstance {
|
|
@@ -16,14 +16,14 @@ export interface EditTableInstance {
|
|
|
16
16
|
export interface HEditTableProps<T = any>
|
|
17
17
|
extends Omit<
|
|
18
18
|
EditableProTableProps<T, ParamsType>,
|
|
19
|
-
"recordCreatorProps" | "request" | "pagination"
|
|
19
|
+
"recordCreatorProps" | "request" | "pagination"|"dataSource"
|
|
20
20
|
> {
|
|
21
21
|
creatorButtonText?: string;
|
|
22
22
|
defaultRecordValue?: T;
|
|
23
23
|
recordCreatorProps?: Partial<
|
|
24
24
|
EditableProTableProps<T, ParamsType>["recordCreatorProps"]
|
|
25
25
|
>;
|
|
26
|
-
dataSource?: any[];
|
|
26
|
+
dataSource?: ResultModal | any[];
|
|
27
27
|
request?: (params: Record<string, any>) => Promise<T>;
|
|
28
28
|
pagination?: IPaginationProps | false;
|
|
29
29
|
manual?: boolean;
|
|
@@ -58,7 +58,7 @@ export default () => {
|
|
|
58
58
|
</>
|
|
59
59
|
);
|
|
60
60
|
}}
|
|
61
|
-
request={() => {
|
|
61
|
+
request={(params) => {
|
|
62
62
|
return new Promise((resolve) => {
|
|
63
63
|
setTimeout(() => {
|
|
64
64
|
resolve({
|
|
@@ -81,7 +81,7 @@ export default () => {
|
|
|
81
81
|
}}
|
|
82
82
|
editDialogTable={dialogTable}
|
|
83
83
|
configData={[
|
|
84
|
-
{ title: "标题", dataIndex: "title" },
|
|
84
|
+
{ title: "标题", dataIndex: "title" ,sorter:true},
|
|
85
85
|
{ title: "标题2", dataIndex: "time", valueType: "date" },
|
|
86
86
|
{
|
|
87
87
|
title: "操作",
|