@fe-free/core 1.5.1 → 1.5.2
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/CHANGELOG.md +7 -0
- package/package.json +2 -2
- package/src/crud/crud_of_simple.tsx +2 -0
- package/src/table/index.tsx +18 -11
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fe-free/core",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"author": "",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"react-syntax-highlighter": "^15.5.0",
|
|
37
37
|
"vanilla-jsoneditor": "^0.23.1",
|
|
38
38
|
"zustand": "^4.5.4",
|
|
39
|
-
"@fe-free/tool": "1.5.
|
|
39
|
+
"@fe-free/tool": "1.5.2"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@ant-design/pro-components": "^2.8.7",
|
package/src/table/index.tsx
CHANGED
|
@@ -37,6 +37,23 @@ function Table<
|
|
|
37
37
|
|
|
38
38
|
const hasSearch = !!newColumns?.find((column) => column.search);
|
|
39
39
|
|
|
40
|
+
let newSearch: any = undefined;
|
|
41
|
+
if (hasSearch) {
|
|
42
|
+
newSearch = {
|
|
43
|
+
labelWidth: 'auto',
|
|
44
|
+
defaultCollapsed: false,
|
|
45
|
+
...search,
|
|
46
|
+
};
|
|
47
|
+
} else if (search === false) {
|
|
48
|
+
newSearch = false;
|
|
49
|
+
} else {
|
|
50
|
+
newSearch = {
|
|
51
|
+
...search,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
console.log('newSearch', newSearch);
|
|
56
|
+
|
|
40
57
|
return (
|
|
41
58
|
<ProTable<DataSource, Params>
|
|
42
59
|
cardBordered
|
|
@@ -46,17 +63,7 @@ function Table<
|
|
|
46
63
|
// @ts-ignore 不会处理这里的 ts,或者成本大
|
|
47
64
|
columns={newColumns}
|
|
48
65
|
scroll={getTableScroll(newColumns)}
|
|
49
|
-
search={
|
|
50
|
-
hasSearch
|
|
51
|
-
? {
|
|
52
|
-
labelWidth: 'auto',
|
|
53
|
-
defaultCollapsed: false,
|
|
54
|
-
...search,
|
|
55
|
-
}
|
|
56
|
-
: {
|
|
57
|
-
...search,
|
|
58
|
-
}
|
|
59
|
-
}
|
|
66
|
+
search={newSearch}
|
|
60
67
|
{...rest}
|
|
61
68
|
/>
|
|
62
69
|
);
|