ronds-metadata 1.0.96 → 1.0.99
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/comps/Editable/index.js +1 -1
- package/es/comps/MetadataEdit/index.d.ts +5 -0
- package/es/comps/MetadataEdit/index.js +11 -1
- package/es/comps/locales/en-US.d.ts +1 -0
- package/es/comps/locales/en-US.js +2 -1
- package/es/comps/locales/zh-CN.d.ts +1 -0
- package/es/comps/locales/zh-CN.js +2 -1
- package/package.json +1 -1
@@ -1,3 +1,4 @@
|
|
1
|
+
import { FormInstance } from 'antd';
|
1
2
|
import './index.less';
|
2
3
|
interface IMetadataEditProps {
|
3
4
|
/**
|
@@ -20,6 +21,10 @@ interface IMetadataEditProps {
|
|
20
21
|
* 添加新的引用类型点击事件
|
21
22
|
*/
|
22
23
|
onNewRefClick?: () => void;
|
24
|
+
/**
|
25
|
+
* 获取表单的实例
|
26
|
+
*/
|
27
|
+
getFormInstance?: (form: FormInstance) => void;
|
23
28
|
}
|
24
29
|
declare const MetadataEdit: (props: IMetadataEditProps) => JSX.Element;
|
25
30
|
export default MetadataEdit;
|
@@ -23,7 +23,8 @@ var MetadataEdit = function MetadataEdit(props) {
|
|
23
23
|
isNameDisabled = props.isNameDisabled,
|
24
24
|
metadataTag = props.metadataTag,
|
25
25
|
onFinish = props.onFinish,
|
26
|
-
onNewRefClick = props.onNewRefClick
|
26
|
+
onNewRefClick = props.onNewRefClick,
|
27
|
+
getFormInstance = props.getFormInstance;
|
27
28
|
|
28
29
|
var _Form$useForm = _Form.useForm(),
|
29
30
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
@@ -62,7 +63,16 @@ var MetadataEdit = function MetadataEdit(props) {
|
|
62
63
|
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
63
64
|
curFields = _React$useState10[0],
|
64
65
|
setCurFields = _React$useState10[1];
|
66
|
+
/**
|
67
|
+
* 获取form的实例
|
68
|
+
*/
|
65
69
|
|
70
|
+
|
71
|
+
React.useEffect(function () {
|
72
|
+
if (form) {
|
73
|
+
getFormInstance && getFormInstance(form);
|
74
|
+
}
|
75
|
+
}, [form]);
|
66
76
|
React.useEffect(function () {
|
67
77
|
form.setFieldsValue({
|
68
78
|
id: 'Test'
|
@@ -10,5 +10,6 @@ export default {
|
|
10
10
|
请先保存正在编辑的行: 'Please save the line being edited first',
|
11
11
|
请输入key: 'Please enter key',
|
12
12
|
请输入title: 'Please enter title',
|
13
|
-
确认会删除该列: 'Confirm will delete the column?'
|
13
|
+
确认会删除该列: 'Confirm will delete the column?',
|
14
|
+
当前值无修改: 'No change to current value'
|
14
15
|
};
|