ronds-metadata 1.2.18 → 1.2.19

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,13 +2,15 @@ import "antd/es/form/style";
2
2
  import _Form from "antd/es/form";
3
3
  import "antd/es/select/style";
4
4
  import _Select from "antd/es/select";
5
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
6
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
7
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
6
8
  var _excluded = ["dataIndex", "mode", "disabled"];
7
9
 
8
10
  /*
9
11
  * @Author: wangxian
10
12
  * @Date: 2022-03-04 14:53:50
11
- * @LastEditTime: 2022-10-10 13:47:12
13
+ * @LastEditTime: 2023-03-07 16:05:56
12
14
  */
13
15
  import React from 'react';
14
16
  import { EditableContext } from '../interface';
@@ -22,6 +24,18 @@ function Index(props) {
22
24
  var _ref = React.useContext(EditableContext) || undefined,
23
25
  editConfig = _ref.editConfig;
24
26
 
27
+ var _React$useState = React.useState([]),
28
+ _React$useState2 = _slicedToArray(_React$useState, 2),
29
+ options = _React$useState2[0],
30
+ setOptions = _React$useState2[1];
31
+
32
+ React.useEffect(function () {
33
+ if (restProps.enum) {
34
+ Promise.resolve(restProps.enum).then(function (value) {
35
+ setOptions(_toConsumableArray(value));
36
+ });
37
+ }
38
+ }, [restProps === null || restProps === void 0 ? void 0 : restProps.enum]);
25
39
  return /*#__PURE__*/React.createElement(_Form.Item, {
26
40
  name: dataIndex,
27
41
  style: {
@@ -41,7 +55,7 @@ function Index(props) {
41
55
  width: '100%'
42
56
  },
43
57
  size: "small",
44
- options: restProps.enum
58
+ options: options
45
59
  }));
46
60
  }
47
61
 
@@ -1,23 +1,23 @@
1
- .canvas-wrapper {
2
- .drag-item {
3
- position: relative;
4
- border: 1px dashed var(--ronds-metadata-color-border-1);
5
- background: var(--ronds-metadata-color-bg-4);
6
- margin-bottom: 8px;
7
- }
8
-
9
- .drag-item-selected {
10
- border: 1px solid var(--ronds-metadata-color-border-2);
11
- }
12
-
13
- .ant-form-item {
14
- margin-bottom: '4px' !important;
15
- }
16
- .ant-form-item-label {
17
- padding: 0 0 2px !important;
18
- }
19
- .ant-input-number,
20
- .ant-picker {
21
- width: 100%;
22
- }
23
- }
1
+ .canvas-wrapper {
2
+ .drag-item {
3
+ position: relative;
4
+ border: 1px dashed var(--ronds-metadata-color-border-1);
5
+ background: var(--ronds-metadata-color-bg-4);
6
+ margin-bottom: 8px;
7
+ }
8
+
9
+ .drag-item-selected {
10
+ border: 1px solid var(--ronds-metadata-color-border-2);
11
+ }
12
+
13
+ .ant-form-item {
14
+ margin-bottom: '4px' !important;
15
+ }
16
+ .ant-form-item-label {
17
+ padding: 0 0 2px !important;
18
+ }
19
+ .ant-input-number,
20
+ .ant-picker {
21
+ width: 100%;
22
+ }
23
+ }
@@ -1,41 +1,41 @@
1
- pre {
2
- margin: 0;
3
- font-weight: 900;
4
- font-size: 14px;
5
- }
6
- .string {
7
- color: #3ab54a;
8
- }
9
- .number {
10
- color: #25aae2;
11
- }
12
- .boolean {
13
- color: #f98280;
14
- }
15
- .null {
16
- color: #f1592a;
17
- }
18
- .width-10 {
19
- width: 10px;
20
- }
21
- .key {
22
- color: #92278f;
23
- }
24
- .open {
25
- display: inline-block;
26
- width: 12px;
27
- height: 12px;
28
- background: url('./icon/close.png') no-repeat;
29
- background-size: 100% 100%;
30
- vertical-align: middle;
31
- cursor: pointer;
32
- }
33
- .close {
34
- display: inline-block;
35
- width: 12px;
36
- height: 12px;
37
- background: url('./icon/open.png') no-repeat;
38
- background-size: 100% 100%;
39
- vertical-align: middle;
40
- cursor: pointer;
41
- }
1
+ pre {
2
+ margin: 0;
3
+ font-weight: 900;
4
+ font-size: 14px;
5
+ }
6
+ .string {
7
+ color: #3ab54a;
8
+ }
9
+ .number {
10
+ color: #25aae2;
11
+ }
12
+ .boolean {
13
+ color: #f98280;
14
+ }
15
+ .null {
16
+ color: #f1592a;
17
+ }
18
+ .width-10 {
19
+ width: 10px;
20
+ }
21
+ .key {
22
+ color: #92278f;
23
+ }
24
+ .open {
25
+ display: inline-block;
26
+ width: 12px;
27
+ height: 12px;
28
+ background: url('./icon/close.png') no-repeat;
29
+ background-size: 100% 100%;
30
+ vertical-align: middle;
31
+ cursor: pointer;
32
+ }
33
+ .close {
34
+ display: inline-block;
35
+ width: 12px;
36
+ height: 12px;
37
+ background: url('./icon/open.png') no-repeat;
38
+ background-size: 100% 100%;
39
+ vertical-align: middle;
40
+ cursor: pointer;
41
+ }