ronds-metadata 1.0.55 → 1.0.56

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.
@@ -11,9 +11,12 @@ import { useGetExtraInfo } from '../hooks';
11
11
  import { getDataCell } from '../utils';
12
12
 
13
13
  function Index(props) {
14
+ var _fields$0$value;
15
+
14
16
  var id = props.id,
15
17
  items = props.items,
16
18
  isRefForm = props.isRefForm,
19
+ fields = props.fields,
17
20
  initEnumValue = props.initEnumValue,
18
21
  disabled = props.disabled;
19
22
  var formContext = React.useContext(MetadataFormContext) || {};
@@ -30,6 +33,7 @@ function Index(props) {
30
33
  setHelp(arr[arr.length - 1]);
31
34
  }
32
35
  }, [items]);
36
+ debugger;
33
37
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
34
38
  style: {
35
39
  position: 'relative',
@@ -39,7 +43,7 @@ function Index(props) {
39
43
  className: "ant-form-item-label mt-1"
40
44
  }, /*#__PURE__*/React.createElement("label", {
41
45
  className: "".concat((extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require) && 'ant-form-item-required')
42
- }, extraInfo.label || id)), formContext.isShowTypeInfo && /*#__PURE__*/React.createElement("div", {
46
+ }, extraInfo.label || ((_fields$0$value = fields[0].value) === null || _fields$0$value === void 0 ? void 0 : _fields$0$value.label) || id)), formContext.isShowTypeInfo && /*#__PURE__*/React.createElement("div", {
43
47
  style: {
44
48
  padding: '0 6px',
45
49
  position: 'absolute',
@@ -55,7 +59,8 @@ function Index(props) {
55
59
  borderRadius: '4px'
56
60
  }
57
61
  }, /*#__PURE__*/React.createElement(_Form.List, {
58
- name: id
62
+ name: id,
63
+ key: id
59
64
  }, function (fields, _ref) {
60
65
  var add = _ref.add,
61
66
  remove = _ref.remove;
@@ -10,6 +10,12 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
10
10
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
11
11
  import "antd/es/input/style";
12
12
  import _Input from "antd/es/input";
13
+
14
+ /*
15
+ * @Author: wangxian
16
+ * @Date: 2021-09-18 14:15:04
17
+ * @LastEditTime: 2022-04-02 17:18:27
18
+ */
13
19
  import React from 'react';
14
20
  import { BgColorsOutlined } from '@ant-design/icons';
15
21
  import { SketchPicker } from 'react-color';
@@ -1,20 +1,19 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import "antd/es/form/style";
3
3
  import _Form from "antd/es/form";
4
+ import "antd/es/select/style";
5
+ import _Select from "antd/es/select";
4
6
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
5
7
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
6
8
  import _regeneratorRuntime from "@babel/runtime/regenerator";
7
9
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
8
10
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
9
- import "antd/es/select/style";
10
- import _Select from "antd/es/select";
11
11
  import React from 'react';
12
12
  import { MetadataService } from '../../../framework/metadata/MetadataService';
13
13
  import { MetadataFormContext, MetadataRefContext } from '../interface';
14
14
  import { useGetExtraInfo } from '../hooks';
15
15
  import { renderForm } from '../utils';
16
16
  import { JsonMetadataProvider } from '../../../framework/metadata';
17
- var Option = _Select.Option;
18
17
 
19
18
  function Index(props) {
20
19
  var _extraInfo$disabled, _extraInfo$disabled2;
@@ -94,10 +93,10 @@ function Index(props) {
94
93
  }, _callee);
95
94
  })), []);
96
95
  React.useEffect(function () {
97
- if (refId) {
96
+ if (refId && isRefForm) {
98
97
  onSearch();
99
98
  }
100
- }, [refId, onSearch]);
99
+ }, [refId, isRefForm, onSearch]);
101
100
  var formOptions = React.useMemo(function () {
102
101
  return {
103
102
  disabled: disabled,
@@ -5,7 +5,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
5
  /*
6
6
  * @Author: your name
7
7
  * @Date: 2021-09-18 14:15:04
8
- * @LastEditTime: 2021-12-03 16:00:13
8
+ * @LastEditTime: 2022-04-02 16:44:45
9
9
  * @LastEditors: Please set LastEditors
10
10
  * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
11
11
  * @FilePath: \ronds.metadata\src\comps\MetadataForm\hooks\index.tsx
@@ -30,6 +30,7 @@ export interface IMetaFormProps {
30
30
  isRefForm?: boolean;
31
31
  initEnumValue?: any;
32
32
  field?: any;
33
+ fields?: any[];
33
34
  name?: string[];
34
35
  isObj?: boolean;
35
36
  refId?: string;
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author:wangxian
3
3
  * @Date: 2021-09-18 14:15:04
4
- * @LastEditTime: 2022-04-01 16:58:54
4
+ * @LastEditTime: 2022-04-02 17:06:28
5
5
  */
6
6
  import React from 'react';
7
7
  export var MetadataFormContext = /*#__PURE__*/React.createContext(null);
@@ -5,7 +5,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
5
5
  /*
6
6
  * @Author: wangxian
7
7
  * @Date: 2021-09-18 14:15:04
8
- * @LastEditTime: 2022-04-02 15:10:04
8
+ * @LastEditTime: 2022-04-02 17:19:55
9
9
  */
10
10
  import React from 'react';
11
11
  import Input from './DataCell/Input';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "ronds-metadata",
4
- "version": "1.0.55",
4
+ "version": "1.0.56",
5
5
  "scripts": {
6
6
  "start": "dumi dev",
7
7
  "docs:build": "dumi build",