ronds-metadata 1.2.32 → 1.2.33

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,10 @@
1
- .metadata-edit {
2
- height: 100%;
3
- width: 100%;
4
- .ant-row {
5
- display: block;
6
- }
7
- .pr-10 {
8
- padding-right: 10px;
9
- }
10
- }
1
+ .metadata-edit {
2
+ height: 100%;
3
+ width: 100%;
4
+ .ant-row {
5
+ display: block;
6
+ }
7
+ .pr-10 {
8
+ padding-right: 10px;
9
+ }
10
+ }
@@ -1,20 +1,20 @@
1
- export interface IMetaFileds {
2
- id: string;
3
- type: 'object';
4
- properties: any[];
5
- value: any;
6
- }
7
-
8
- export type ITypeStatus = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array';
9
-
10
- export type IMetaProperty = {
11
- /**
12
- * 属性的名称
13
- */
14
- id: string;
15
- /**
16
- * 类型
17
- */
18
- type: string;
19
- enum?: any[];
20
- };
1
+ export interface IMetaFileds {
2
+ id: string;
3
+ type: 'object';
4
+ properties: any[];
5
+ value: any;
6
+ }
7
+
8
+ export type ITypeStatus = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array';
9
+
10
+ export type IMetaProperty = {
11
+ /**
12
+ * 属性的名称
13
+ */
14
+ id: string;
15
+ /**
16
+ * 类型
17
+ */
18
+ type: string;
19
+ enum?: any[];
20
+ };
@@ -12,7 +12,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
12
12
  /*
13
13
  * @Author: wangxian
14
14
  * @Date: 2021-09-18 14:15:04
15
- * @LastEditTime: 2023-02-27 10:41:49
15
+ * @LastEditTime: 2023-04-18 10:27:43
16
16
  */
17
17
  import React from 'react';
18
18
  import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
@@ -90,6 +90,7 @@ function Index(props) {
90
90
  }
91
91
  }, extraInfo.layout === 'table' && items.type === 'ref' ? /*#__PURE__*/React.createElement(TableArray, {
92
92
  initValue: formContext.initialValues,
93
+ extraInfo: extraInfo,
93
94
  initEnumValue: initEnumValue,
94
95
  readonly: (_extraInfo$disabled = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled !== void 0 ? _extraInfo$disabled : disabled,
95
96
  addButtonHidden: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.addButtonHidden,
@@ -4,6 +4,7 @@ interface ITableArrayProps {
4
4
  form: FormInstance;
5
5
  refId: string;
6
6
  initEnumValue: any[];
7
+ extraInfo?: any;
7
8
  readonly?: boolean;
8
9
  rowNumber: number;
9
10
  addButtonHidden?: boolean;
@@ -21,6 +21,7 @@ import { STREAM_EVENT_TYPE } from '../../constants';
21
21
  var TableArray = function TableArray(props) {
22
22
  var initValue = props.initValue,
23
23
  readonly = props.readonly,
24
+ extraInfo = props.extraInfo,
24
25
  rowNumber = props.rowNumber,
25
26
  initEnumValue = props.initEnumValue,
26
27
  addButtonHidden = props.addButtonHidden,
@@ -186,6 +187,13 @@ var TableArray = function TableArray(props) {
186
187
 
187
188
  return function () {};
188
189
  }, [refId]);
190
+ React.useEffect(function () {
191
+ if ((extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.defaultValue) && firstLoadRef.current) {
192
+ setList(_toConsumableArray(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.defaultValue));
193
+ listRef.current = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.defaultValue;
194
+ firstLoadRef.current = false;
195
+ }
196
+ }, [extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.defaultValue, form]);
189
197
  React.useEffect(function () {
190
198
  if (initValue && firstLoadRef.current) {
191
199
  if (typeof name === 'string' && initValue[name]) {
@@ -34,8 +34,6 @@ export function withAddOnAfter(WrappedComponent) {
34
34
  cellColSpan = _React$useState4[0],
35
35
  setCellColSpan = _React$useState4[1];
36
36
 
37
- if (id === 'p' || id === 'user') {}
38
-
39
37
  var labelSpan = React.useMemo(function () {
40
38
  var _fields$0$value, _fields$0$value$commo;
41
39
 
@@ -1,41 +1,41 @@
1
- .with-add-on-after {
2
- --card-bg: #ffffff;
3
- position: relative;
4
- width: 100%;
5
-
6
- .ant-form-item-label {
7
- padding: 0 !important;
8
- }
9
-
10
- & > .ant-form-item {
11
- padding: 0 0 8px !important;
12
- flex: 1;
13
- }
14
- &-extra {
15
- position: absolute;
16
- right: 20px;
17
- top: 18px;
18
- padding: 0 6px;
19
- background-color: var(--card-bg);
20
- z-index: 1000;
21
- }
22
- &-ref {
23
- position: absolute;
24
- right: 20px;
25
- top: -10px;
26
- padding: 0 6px;
27
- background-color: var(--card-bg);
28
- z-index: 1000;
29
- }
30
- .ant-select-tree-indent {
31
- .ant-select-tree-indent-unit {
32
- width: 10px !important;
33
- }
34
- }
35
-
36
- /* .ant-col-2.7 {
37
- display: block;
38
- flex: 0 0 75%;
39
- max-width: 75%;
40
- } */
41
- }
1
+ .with-add-on-after {
2
+ --card-bg: #ffffff;
3
+ position: relative;
4
+ width: 100%;
5
+
6
+ .ant-form-item-label {
7
+ padding: 0 !important;
8
+ }
9
+
10
+ & > .ant-form-item {
11
+ padding: 0 0 8px !important;
12
+ flex: 1;
13
+ }
14
+ &-extra {
15
+ position: absolute;
16
+ right: 20px;
17
+ top: 18px;
18
+ padding: 0 6px;
19
+ background-color: var(--card-bg);
20
+ z-index: 1000;
21
+ }
22
+ &-ref {
23
+ position: absolute;
24
+ right: 20px;
25
+ top: -10px;
26
+ padding: 0 6px;
27
+ background-color: var(--card-bg);
28
+ z-index: 1000;
29
+ }
30
+ .ant-select-tree-indent {
31
+ .ant-select-tree-indent-unit {
32
+ width: 10px !important;
33
+ }
34
+ }
35
+
36
+ /* .ant-col-2.7 {
37
+ display: block;
38
+ flex: 0 0 75%;
39
+ max-width: 75%;
40
+ } */
41
+ }
@@ -1,98 +1,98 @@
1
- /*
2
- * @Author: wangxian
3
- * @Date: 2021-09-18 14:15:04
4
- * @LastEditTime: 2023-02-09 18:37:15
5
- */
6
- export type IMetaType = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array' | string;
7
-
8
- export type IMetaData = {
9
- /**
10
- * 类名称/属性名称
11
- */
12
- id: string;
13
- /**
14
- * 类型
15
- */
16
- type: IMetaType;
17
- /**
18
- * 属性
19
- */
20
- properties?: IMetaProperties[];
21
-
22
- /**
23
- * 引用id
24
- */
25
- refId?: string;
26
- /**
27
- * 静态的变量
28
- */
29
- fields?: IMetaFileds[];
30
- /**
31
- * 内部类
32
- */
33
- types?: IMetaData[];
34
- };
35
-
36
- export type IMetaProperties = {
37
- /**
38
- * 类规则名称
39
- */
40
- id: string;
41
-
42
- /**
43
- * 类型
44
- */
45
- type: IMetaType;
46
-
47
- /**
48
- * 引用id
49
- */
50
- refId?: string;
51
- /**
52
- * 静态的变量
53
- */
54
- fields?: IMetaFileds[];
55
- /**
56
- * 枚举值
57
- */
58
- enum?: { value: string }[];
59
- /**
60
- * 数组类型
61
- */
62
- items?: { type: IMetaType; refId?: string };
63
- };
64
-
65
- export type IMetaFileds = {
66
- /**
67
- * 规则名称
68
- */
69
- id: string;
70
-
71
- /**
72
- * 类型
73
- */
74
- type: IMetaType;
75
-
76
- /**
77
- * 引用id
78
- */
79
- refId?: string;
80
-
81
- /**
82
- * 规则值
83
- */
84
- value: any;
85
- };
86
-
87
- export interface IAPI {
88
- // 获取元数据列表
89
- GetMetadataList(keyWords?: string[]): Promise<{ id: string; name: string; schema: string }[]>;
90
- // 通过元数据Id获取元数据详情
91
- GetMetadataDetailById(metadataId: string): Promise<any>;
92
- // 新增元数据
93
- SaveMetadata(data: any, metadataTag: string): Promise<any>;
94
- // 获取元数据的值
95
- GetMetadataObjList(data: any): Promise<any[]>;
96
- /** 通过扩展规则获取枚举类型的值 */
97
- GetEnumDataByUrl(url: string, method: 'get' | 'post', body: any): Promise<any>;
98
- }
1
+ /*
2
+ * @Author: wangxian
3
+ * @Date: 2021-09-18 14:15:04
4
+ * @LastEditTime: 2023-02-09 18:37:15
5
+ */
6
+ export type IMetaType = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array' | string;
7
+
8
+ export type IMetaData = {
9
+ /**
10
+ * 类名称/属性名称
11
+ */
12
+ id: string;
13
+ /**
14
+ * 类型
15
+ */
16
+ type: IMetaType;
17
+ /**
18
+ * 属性
19
+ */
20
+ properties?: IMetaProperties[];
21
+
22
+ /**
23
+ * 引用id
24
+ */
25
+ refId?: string;
26
+ /**
27
+ * 静态的变量
28
+ */
29
+ fields?: IMetaFileds[];
30
+ /**
31
+ * 内部类
32
+ */
33
+ types?: IMetaData[];
34
+ };
35
+
36
+ export type IMetaProperties = {
37
+ /**
38
+ * 类规则名称
39
+ */
40
+ id: string;
41
+
42
+ /**
43
+ * 类型
44
+ */
45
+ type: IMetaType;
46
+
47
+ /**
48
+ * 引用id
49
+ */
50
+ refId?: string;
51
+ /**
52
+ * 静态的变量
53
+ */
54
+ fields?: IMetaFileds[];
55
+ /**
56
+ * 枚举值
57
+ */
58
+ enum?: { value: string }[];
59
+ /**
60
+ * 数组类型
61
+ */
62
+ items?: { type: IMetaType; refId?: string };
63
+ };
64
+
65
+ export type IMetaFileds = {
66
+ /**
67
+ * 规则名称
68
+ */
69
+ id: string;
70
+
71
+ /**
72
+ * 类型
73
+ */
74
+ type: IMetaType;
75
+
76
+ /**
77
+ * 引用id
78
+ */
79
+ refId?: string;
80
+
81
+ /**
82
+ * 规则值
83
+ */
84
+ value: any;
85
+ };
86
+
87
+ export interface IAPI {
88
+ // 获取元数据列表
89
+ GetMetadataList(keyWords?: string[]): Promise<{ id: string; name: string; schema: string }[]>;
90
+ // 通过元数据Id获取元数据详情
91
+ GetMetadataDetailById(metadataId: string): Promise<any>;
92
+ // 新增元数据
93
+ SaveMetadata(data: any, metadataTag: string): Promise<any>;
94
+ // 获取元数据的值
95
+ GetMetadataObjList(data: any): Promise<any[]>;
96
+ /** 通过扩展规则获取枚举类型的值 */
97
+ GetEnumDataByUrl(url: string, method: 'get' | 'post', body: any): Promise<any>;
98
+ }
package/es/theme.less CHANGED
@@ -1,79 +1,79 @@
1
- .ronds-metadata-dark {
2
- --ronds-metadata-color-border-1: #314162;
3
- --ronds-metadata-color-border-2: #0d9af3;
4
- --ronds-metadata-color-bg-2: #0d1f40;
5
- --ronds-metadata-color-bg-3: #021125;
6
- --ronds-metadata-color-bg-4: #1c3771;
7
- --ronds-metadata-color-bg-5: #13264E;
8
- --ronds-metadata-color-text-1: #ffffff;
9
- --ronds-metadata-color-text-2: #ffffff;
10
- --ronds-metadata-color-text-3: #ffffff;
11
-
12
- ::-webkit-scrollbar {
13
- width: 6px;
14
- height: 6px;
15
- overflow: auto;
16
- }
17
- ::-webkit-scrollbar-corner {
18
- background-color: transparent;
19
- color: transparent;
20
- }
21
-
22
- ::-webkit-scrollbar-thumb {
23
- box-shadow: inset 0 0 5px var(--scrollbar-bg-color);
24
- background: var(--scrollbar-color);
25
- min-height: 25px;
26
- min-width: 25px;
27
- border-radius: 3px;
28
-
29
- &:hover {
30
- border-radius: 2px;
31
- // box-shadow: inset 0 0 5px var(--scrollbar-color-hover);
32
- background: var(--scrollbar-color-hover);
33
- }
34
-
35
- &:active {
36
- // box-shadow: inset 0 0 5px var(--scrollbar-bg-color);
37
- background: var(--scrollbar-color-hover);
38
- }
39
- }
40
- }
41
-
42
- .ronds-metadata-normal {
43
- --ronds-metadata-color-border-1: #d9d9d9;
44
- --ronds-metadata-color-border-2: #165dff;
45
- --ronds-metadata-color-bg-2: rgba(229, 238, 255, 0.85);
46
- --ronds-metadata-color-bg-3: #f6f5f6;
47
- --ronds-metadata-color-bg-4: #ffffff;
48
- --ronds-metadata-color-bg-5: #ffffff;
49
- --ronds-metadata-color-text-1: #1d2129;
50
- --ronds-metadata-color-text-2: #24292f;
51
- --ronds-metadata-color-text-3: #f2f3f5;
52
-
53
- ::-webkit-scrollbar {
54
- width: 6px;
55
- height: 6px;
56
- overflow: auto;
57
- }
58
-
59
- ::-webkit-scrollbar-thumb {
60
- background-color: var(--scrollbar-color);
61
- min-height: 25px;
62
- min-width: 25px;
63
- border-radius: 3px;
64
-
65
- &:hover {
66
- background-color: #a8a8a8;
67
- }
68
-
69
- &:active {
70
- background-color: #787878;
71
- }
72
-
73
- /* border: 1px solid #e0e0e0; */
74
- }
75
-
76
- ::-webkit-scrollbar-track {
77
- background-color: #f7f7f7;
78
- }
79
- }
1
+ .ronds-metadata-dark {
2
+ --ronds-metadata-color-border-1: #314162;
3
+ --ronds-metadata-color-border-2: #0d9af3;
4
+ --ronds-metadata-color-bg-2: #0d1f40;
5
+ --ronds-metadata-color-bg-3: #021125;
6
+ --ronds-metadata-color-bg-4: #1c3771;
7
+ --ronds-metadata-color-bg-5: #13264e;
8
+ --ronds-metadata-color-text-1: #ffffff;
9
+ --ronds-metadata-color-text-2: #ffffff;
10
+ --ronds-metadata-color-text-3: #ffffff;
11
+
12
+ ::-webkit-scrollbar {
13
+ width: 6px;
14
+ height: 6px;
15
+ overflow: auto;
16
+ }
17
+ ::-webkit-scrollbar-corner {
18
+ background-color: transparent;
19
+ color: transparent;
20
+ }
21
+
22
+ ::-webkit-scrollbar-thumb {
23
+ box-shadow: inset 0 0 5px var(--scrollbar-bg-color);
24
+ background: var(--scrollbar-color);
25
+ min-height: 25px;
26
+ min-width: 25px;
27
+ border-radius: 3px;
28
+
29
+ &:hover {
30
+ border-radius: 2px;
31
+ // box-shadow: inset 0 0 5px var(--scrollbar-color-hover);
32
+ background: var(--scrollbar-color-hover);
33
+ }
34
+
35
+ &:active {
36
+ // box-shadow: inset 0 0 5px var(--scrollbar-bg-color);
37
+ background: var(--scrollbar-color-hover);
38
+ }
39
+ }
40
+ }
41
+
42
+ .ronds-metadata-normal {
43
+ --ronds-metadata-color-border-1: #d9d9d9;
44
+ --ronds-metadata-color-border-2: #165dff;
45
+ --ronds-metadata-color-bg-2: rgba(229, 238, 255, 0.85);
46
+ --ronds-metadata-color-bg-3: #f6f5f6;
47
+ --ronds-metadata-color-bg-4: #ffffff;
48
+ --ronds-metadata-color-bg-5: #ffffff;
49
+ --ronds-metadata-color-text-1: #1d2129;
50
+ --ronds-metadata-color-text-2: #24292f;
51
+ --ronds-metadata-color-text-3: #f2f3f5;
52
+
53
+ ::-webkit-scrollbar {
54
+ width: 6px;
55
+ height: 6px;
56
+ overflow: auto;
57
+ }
58
+
59
+ ::-webkit-scrollbar-thumb {
60
+ background-color: var(--scrollbar-color);
61
+ min-height: 25px;
62
+ min-width: 25px;
63
+ border-radius: 3px;
64
+
65
+ &:hover {
66
+ background-color: #a8a8a8;
67
+ }
68
+
69
+ &:active {
70
+ background-color: #787878;
71
+ }
72
+
73
+ /* border: 1px solid #e0e0e0; */
74
+ }
75
+
76
+ ::-webkit-scrollbar-track {
77
+ background-color: #f7f7f7;
78
+ }
79
+ }