@fe-free/core 1.5.0 → 1.5.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/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.1",
|
|
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.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@ant-design/pro-components": "^2.8.7",
|
|
@@ -11,7 +11,7 @@ function Edit<T>(props: {
|
|
|
11
11
|
onChange: (values: T) => void;
|
|
12
12
|
detailForm: JSX.Element;
|
|
13
13
|
editForm?: any;
|
|
14
|
-
|
|
14
|
+
disabledSubmitter?: boolean;
|
|
15
15
|
}) {
|
|
16
16
|
const handleFinish = async (newValues) => {
|
|
17
17
|
props.onChange(newValues as T);
|
|
@@ -26,31 +26,7 @@ function Edit<T>(props: {
|
|
|
26
26
|
onFinish={handleFinish}
|
|
27
27
|
formRef={props?.editForm}
|
|
28
28
|
initialValues={props.values || undefined}
|
|
29
|
-
submitter={
|
|
30
|
-
props.disabledAddFormSubmitter
|
|
31
|
-
? false
|
|
32
|
-
: {
|
|
33
|
-
render: (props, defaultDoms) => {
|
|
34
|
-
return [
|
|
35
|
-
<div
|
|
36
|
-
key="cancel"
|
|
37
|
-
className="pr-[20px] w-[500px] pt-[12px]"
|
|
38
|
-
style={{ borderTop: '1px solid rgba(0, 0, 0, 0.1)' }}
|
|
39
|
-
>
|
|
40
|
-
<div className="custom-button-container">
|
|
41
|
-
{React.Children.map(defaultDoms, (dom) => {
|
|
42
|
-
return React.cloneElement(dom, {
|
|
43
|
-
className:
|
|
44
|
-
'w-[88px] h-[40px] text-base rounded-[0.5rem] ml-3' +
|
|
45
|
-
(dom.props?.className || ''),
|
|
46
|
-
});
|
|
47
|
-
})}
|
|
48
|
-
</div>
|
|
49
|
-
</div>,
|
|
50
|
-
];
|
|
51
|
-
},
|
|
52
|
-
}
|
|
53
|
-
}
|
|
29
|
+
submitter={props.disabledSubmitter ? false : undefined}
|
|
54
30
|
>
|
|
55
31
|
{props.detailForm}
|
|
56
32
|
</ModalForm>
|
|
@@ -66,7 +42,7 @@ interface ProFormListModalHelperProps<T> {
|
|
|
66
42
|
// 如果 addForm 存在,则使用 addForm 作为添加按钮
|
|
67
43
|
addForm?: JSX.Element;
|
|
68
44
|
// 禁用添加的提交按钮
|
|
69
|
-
|
|
45
|
+
disabledSubmitter?: boolean;
|
|
70
46
|
|
|
71
47
|
disabledAdd?: boolean;
|
|
72
48
|
// 触发添加
|
|
@@ -129,7 +105,7 @@ function ProFormListModalHelper<T = any>(props: ProFormListModalHelperProps<T>)
|
|
|
129
105
|
}}
|
|
130
106
|
detailForm={props.addForm || props.detailForm}
|
|
131
107
|
editForm={props?.editForm}
|
|
132
|
-
|
|
108
|
+
disabledSubmitter={props.disabledSubmitter}
|
|
133
109
|
>
|
|
134
110
|
{props.addTrigger || (
|
|
135
111
|
<Button size="small" icon={<PlusOutlined />}>
|