@ecoding/components.antd 0.3.52 → 0.3.54
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.
|
@@ -2,14 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import type { FormListFieldData } from 'antd';
|
|
3
3
|
interface IC {
|
|
4
4
|
type?: "operation";
|
|
5
|
-
title
|
|
5
|
+
title?: string;
|
|
6
6
|
tooltip?: string;
|
|
7
7
|
require?: boolean;
|
|
8
|
-
name
|
|
8
|
+
name?: string;
|
|
9
9
|
rules?: any;
|
|
10
10
|
width?: number;
|
|
11
|
-
hideRemove?: boolean;
|
|
12
|
-
render
|
|
11
|
+
hideRemove?: boolean | ((field: FormListFieldData, index: number) => boolean);
|
|
12
|
+
render?: (field: FormListFieldData, index: number, { add, remove }: {
|
|
13
13
|
add: any;
|
|
14
14
|
remove: any;
|
|
15
15
|
}) => React.ReactNode;
|
|
@@ -42,12 +42,18 @@ const C = ({ columns, rules, tStyle, name, hideHeader, hideBottom, operation, i1
|
|
|
42
42
|
React.createElement("colgroup", null,
|
|
43
43
|
React.createElement("col", { style: Object.assign({}, { width: 60 }) }),
|
|
44
44
|
columns.map((column) => {
|
|
45
|
+
if (column.type == "operation") {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
45
48
|
return (React.createElement("col", { style: Object.assign({}, { width: column.width || 200 }) }));
|
|
46
49
|
}),
|
|
47
50
|
(operation === null || operation === void 0 ? void 0 : operation.hide) ? null : (React.createElement("col", { style: Object.assign({}, { width: (operation === null || operation === void 0 ? void 0 : operation.width) || 150 }) }))),
|
|
48
51
|
React.createElement("thead", null, hideHeader ? null : (React.createElement("tr", null,
|
|
49
52
|
React.createElement("th", { style: thStyle }, i18n ? i18n.$t("global.num", "序号") : "序号"),
|
|
50
53
|
columns.map((column, i) => {
|
|
54
|
+
if (column.type == "operation") {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
51
57
|
if (column.require) {
|
|
52
58
|
return (React.createElement("th", { style: thStyle },
|
|
53
59
|
React.createElement("span", { style: { color: '#ff4d4f' } }, "*"),
|
|
@@ -69,7 +75,7 @@ const C = ({ columns, rules, tStyle, name, hideHeader, hideBottom, operation, i1
|
|
|
69
75
|
return (React.createElement("td", { style: Object.assign({}, tdStyle, { right: 0, position: "sticky", backgroundColor: "#fff" }) },
|
|
70
76
|
React.createElement(Space, null,
|
|
71
77
|
column.render && column.render(field, index, { add, remove }),
|
|
72
|
-
column.hideRemove ?
|
|
78
|
+
(typeof column.hideRemove == "function" && column.hideRemove(field, index)) || (typeof column.hideRemove == "boolean" && column.hideRemove) ? (React.createElement(Typography.Text, { disabled: true }, i18n ? i18n.$t("global.del", '删除') : '删除')) : (React.createElement(Typography.Text, { style: { cursor: 'pointer' }, type: "danger", onClick: () => {
|
|
73
79
|
remove(field.name);
|
|
74
80
|
afterRemove && afterRemove(field.name);
|
|
75
81
|
} }, i18n ? i18n.$t("global.del", '删除') : '删除')))));
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import React, { useRef, useEffect, useState, useMemo } from 'react';
|
|
11
11
|
import { Button, Form, Row, Col, Space } from 'antd';
|
|
12
|
-
const FiltersHorizontal = ({ items, onFinish, onClear, y, setY, overMax, colOpts }) => {
|
|
12
|
+
const FiltersHorizontal = ({ items, onFinish, onClear, y, setY, overMax, colOpts, searchText, resetText }) => {
|
|
13
13
|
const [form] = Form.useForm(); // 该组件内form全局变量
|
|
14
14
|
const ref = useRef(null);
|
|
15
15
|
const refInitY = useRef(undefined);
|
|
@@ -78,11 +78,11 @@ const FiltersHorizontal = ({ items, onFinish, onClear, y, setY, overMax, colOpts
|
|
|
78
78
|
return (React.createElement(Col, Object.assign({}, colProps), item));
|
|
79
79
|
}),
|
|
80
80
|
isOpShowAfter ? (React.createElement(Col, Object.assign({}, colProps, { style: { paddingTop: 4 } }),
|
|
81
|
-
React.createElement(Button, { type: "primary", className: 'mr10', size: 'small', htmlType: "submit" },
|
|
82
|
-
React.createElement(Button, { size: 'small', onClick: clear },
|
|
81
|
+
React.createElement(Button, { type: "primary", className: 'mr10', size: 'small', htmlType: "submit" }, searchText || '搜索'),
|
|
82
|
+
React.createElement(Button, { size: 'small', onClick: clear }, resetText || '重置'))) : null),
|
|
83
83
|
!isOpShowAfter ? (React.createElement(Space, { size: "small", direction: isLineAfter ? undefined : "vertical", style: Object.assign({ width: 90, textAlign: "right" }, isLineAfter ? { width: 130, margin: "4px 0 0 12px" } : {}) },
|
|
84
|
-
React.createElement(Button, { type: "primary", size: 'small', htmlType: "submit" },
|
|
85
|
-
React.createElement(Button, { size: 'small', onClick: clear },
|
|
84
|
+
React.createElement(Button, { type: "primary", size: 'small', htmlType: "submit" }, searchText || '搜索'),
|
|
85
|
+
React.createElement(Button, { size: 'small', onClick: clear }, resetText || '重置'))) : null),
|
|
86
86
|
showMore ? (React.createElement(Button, { type: 'link', onClick: switchShow, style: { fontSize: 12, position: "absolute", bottom: -10, left: '50%', transform: "translateX(-50%)" }, size: 'small' }, moreFlag ? "收起" : "展开更多")) : null));
|
|
87
87
|
};
|
|
88
88
|
FiltersHorizontal.defaultProps = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecoding/components.antd",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.54",
|
|
4
4
|
"author": "cxc",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"antd": "^5.8.4",
|
|
44
44
|
"axios": "^1.1.2"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "688722d27871b2505ee4e8980a97a2bb5344eeb4"
|
|
47
47
|
}
|