ronds-metadata 1.1.91 → 1.1.93
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/FormGenerator/comps/Canvas/core/RenderField/Cell/Obj.js +6 -4
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/HOC/index.js +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/index.d.ts +9 -0
- package/es/comps/FormGenerator/comps/Canvas/core/index.js +35 -4
- package/es/comps/JsonView/index.less +41 -41
- package/es/comps/MetadataEdit/index.less +10 -10
- package/es/comps/MetadataEdit/type.d.ts +20 -20
- package/es/comps/MetadataForm/DataCell/Input.js +30 -9
- package/es/comps/MetadataForm/DataCell/Select.js +23 -9
- package/es/comps/MetadataForm/utils.js +2 -1
- package/es/framework/metadata/types.d.ts +98 -98
- package/es/theme.less +2 -0
- package/package.json +94 -94
@@ -1,20 +1,22 @@
|
|
1
|
-
import React from "react";
|
2
|
-
|
3
1
|
/*
|
4
2
|
* @Author: uloveits 719310130@qq.com
|
5
3
|
* @Date: 2023-02-06 15:05:42
|
6
4
|
* @LastEditors: uloveits 719310130@qq.com
|
7
|
-
* @LastEditTime: 2023-02-
|
5
|
+
* @LastEditTime: 2023-02-14 19:14:21
|
8
6
|
*/
|
9
7
|
import CanvasCore from '../../index';
|
10
8
|
import { withFieldCellWrapper } from '../HOC';
|
9
|
+
import React from 'react';
|
11
10
|
|
12
11
|
var Index = function Index(props) {
|
13
12
|
var data = props.data,
|
14
13
|
fgStream = props.fgStream,
|
15
14
|
setting = props.setting;
|
15
|
+
var nodesRef = React.useRef([]);
|
16
16
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CanvasCore, {
|
17
|
-
|
17
|
+
refId: data.id,
|
18
|
+
onChange: function onChange(nodes) {
|
19
|
+
nodesRef.current = nodes;
|
18
20
|
}
|
19
21
|
}));
|
20
22
|
};
|
@@ -1,6 +1,15 @@
|
|
1
1
|
import { FG } from '../../../../../comps/FormGenerator/index.d';
|
2
2
|
import './index.less';
|
3
3
|
interface ICanvasCoreProps {
|
4
|
+
/**
|
5
|
+
* 对象类型引用的
|
6
|
+
*/
|
7
|
+
refId?: string;
|
8
|
+
/**
|
9
|
+
* 渲染内容回调
|
10
|
+
* @param nodes
|
11
|
+
* @returns
|
12
|
+
*/
|
4
13
|
onChange?: (nodes: FG.Node[]) => void;
|
5
14
|
}
|
6
15
|
declare const CanvasCore: (props: ICanvasCoreProps) => JSX.Element;
|
@@ -19,7 +19,8 @@ import './index.less';
|
|
19
19
|
var CanvasCore = function CanvasCore(props) {
|
20
20
|
var _formSetting$layout;
|
21
21
|
|
22
|
-
var
|
22
|
+
var refId = props.refId,
|
23
|
+
onChange = props.onChange;
|
23
24
|
var fGCtx = React.useContext(FGCtx) || {};
|
24
25
|
|
25
26
|
var _React$useState = React.useState([]),
|
@@ -156,9 +157,28 @@ var CanvasCore = function CanvasCore(props) {
|
|
156
157
|
}
|
157
158
|
|
158
159
|
addNewNode(item.dragItem);
|
160
|
+
},
|
161
|
+
hover: function hover(item, monitor) {
|
162
|
+
// 只检查被hover的最小元素
|
163
|
+
var didHover = monitor.isOver({
|
164
|
+
shallow: true
|
165
|
+
});
|
166
|
+
|
167
|
+
if (didHover) {}
|
168
|
+
},
|
169
|
+
collect: function collect(monitor) {
|
170
|
+
return {
|
171
|
+
isOver: monitor.isOver({
|
172
|
+
shallow: true
|
173
|
+
}),
|
174
|
+
canDrop: monitor.canDrop()
|
175
|
+
};
|
159
176
|
}
|
160
177
|
}),
|
161
178
|
_useDrop2 = _slicedToArray(_useDrop, 2),
|
179
|
+
_useDrop2$ = _useDrop2[0],
|
180
|
+
isOver = _useDrop2$.isOver,
|
181
|
+
canDrop = _useDrop2$.canDrop,
|
162
182
|
dropRef = _useDrop2[1];
|
163
183
|
|
164
184
|
var onSelect = function onSelect(it) {
|
@@ -179,15 +199,17 @@ var CanvasCore = function CanvasCore(props) {
|
|
179
199
|
return _formColSpan;
|
180
200
|
};
|
181
201
|
|
202
|
+
var isActive = canDrop && isOver;
|
182
203
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
183
204
|
className: "canvas-wrapper",
|
184
205
|
ref: dropRef,
|
185
206
|
style: {
|
186
207
|
width: '100%',
|
187
208
|
height: 'calc(100% - 40px)',
|
209
|
+
minHeight: '100px',
|
188
210
|
background: 'var(--ronds-metadata-color-bg-3)',
|
189
211
|
padding: '8px',
|
190
|
-
border: '
|
212
|
+
border: "".concat(isActive ? '2px solid red' : '1px dashed var(--ronds-metadata-color-border-1)'),
|
191
213
|
overflowY: 'auto'
|
192
214
|
}
|
193
215
|
}, /*#__PURE__*/React.createElement(_Form, {
|
@@ -204,10 +226,11 @@ var CanvasCore = function CanvasCore(props) {
|
|
204
226
|
autoComplete: "off"
|
205
227
|
}, /*#__PURE__*/React.createElement(_Row, {
|
206
228
|
gutter: 8
|
207
|
-
}, list.map(function (it) {
|
229
|
+
}, list.length > 0 && list.map(function (it) {
|
208
230
|
var _allSetting$it$id;
|
209
231
|
|
210
232
|
return /*#__PURE__*/React.createElement(_Col, {
|
233
|
+
key: it.id,
|
211
234
|
span: processColSpan(allSetting && ((_allSetting$it$id = allSetting[it.id]) === null || _allSetting$it$id === void 0 ? void 0 : _allSetting$it$id.colSpan), formSetting === null || formSetting === void 0 ? void 0 : formSetting.colSpan),
|
212
235
|
style: {
|
213
236
|
width: '100%'
|
@@ -222,7 +245,15 @@ var CanvasCore = function CanvasCore(props) {
|
|
222
245
|
data: it,
|
223
246
|
isShowAction: curNodeId === it.id
|
224
247
|
})));
|
225
|
-
})
|
248
|
+
}), list.length === 0 && /*#__PURE__*/React.createElement("div", {
|
249
|
+
style: {
|
250
|
+
width: '100%',
|
251
|
+
textAlign: 'center',
|
252
|
+
padding: '20px',
|
253
|
+
color: 'var(--ronds-metadata-color-text-2)',
|
254
|
+
opacity: 0.6
|
255
|
+
}
|
256
|
+
}, "\u62D6\u62FD\u5DE6\u4FA7\u680F\u7684\u7EC4\u4EF6\u8FDB\u884C\u6DFB\u52A0")))));
|
226
257
|
};
|
227
258
|
|
228
259
|
export default CanvasCore;
|
@@ -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
|
+
}
|
@@ -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
|
+
};
|
@@ -1,6 +1,8 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
1
2
|
import "antd/es/form/style";
|
2
3
|
import _Form from "antd/es/form";
|
3
|
-
import
|
4
|
+
import "antd/es/select/style";
|
5
|
+
import _Select from "antd/es/select";
|
4
6
|
import "antd/es/upload/style";
|
5
7
|
import _Upload from "antd/es/upload";
|
6
8
|
import "antd/es/button/style";
|
@@ -15,7 +17,7 @@ import _Input from "antd/es/input";
|
|
15
17
|
/*
|
16
18
|
* @Author: wangxian
|
17
19
|
* @Date: 2021-09-18 14:15:04
|
18
|
-
* @LastEditTime: 2023-02-
|
20
|
+
* @LastEditTime: 2023-02-15 15:54:24
|
19
21
|
*/
|
20
22
|
import React from 'react';
|
21
23
|
import { UploadOutlined } from '@ant-design/icons';
|
@@ -24,7 +26,7 @@ import { useGetExtraInfo, useWatchDepend } from '../hooks';
|
|
24
26
|
var TextArea = _Input.TextArea;
|
25
27
|
|
26
28
|
function Index(props) {
|
27
|
-
var _extraInfo$depend;
|
29
|
+
var _extraInfo$depend, _extraInfo$addonAfter6;
|
28
30
|
|
29
31
|
var id = props.id,
|
30
32
|
isRefForm = props.isRefForm,
|
@@ -57,8 +59,10 @@ function Index(props) {
|
|
57
59
|
}
|
58
60
|
}, [extraInfo]);
|
59
61
|
|
62
|
+
var onChange = function onChange(e) {};
|
63
|
+
|
60
64
|
var processInputType = function processInputType(_type) {
|
61
|
-
var _extraInfo$disabled, _extraInfo$disabled2, _extraInfo$disabled3, _extraInfo$disabled4, _extraInfo$disabled5;
|
65
|
+
var _extraInfo$disabled, _extraInfo$disabled2, _extraInfo$disabled3, _extraInfo$disabled4, _extraInfo$addonAfter, _extraInfo$addonAfter2, _extraInfo$addonAfter3, _extraInfo$addonAfter4, _extraInfo$disabled5;
|
62
66
|
|
63
67
|
switch (_type) {
|
64
68
|
case 'password':
|
@@ -98,9 +102,20 @@ function Index(props) {
|
|
98
102
|
|
99
103
|
default:
|
100
104
|
return /*#__PURE__*/React.createElement(_Input, {
|
105
|
+
addonAfter: ((_extraInfo$addonAfter = extraInfo.addonAfter) === null || _extraInfo$addonAfter === void 0 ? void 0 : _extraInfo$addonAfter.key) ? /*#__PURE__*/React.createElement(_Form.Item, {
|
106
|
+
name: [].concat(_toConsumableArray(name), [(_extraInfo$addonAfter2 = extraInfo.addonAfter) === null || _extraInfo$addonAfter2 === void 0 ? void 0 : _extraInfo$addonAfter2.key]),
|
107
|
+
noStyle: true,
|
108
|
+
initialValue: (_extraInfo$addonAfter3 = extraInfo.addonAfter) === null || _extraInfo$addonAfter3 === void 0 ? void 0 : _extraInfo$addonAfter3.defaultValue
|
109
|
+
}, /*#__PURE__*/React.createElement(_Select, null, (((_extraInfo$addonAfter4 = extraInfo.addonAfter) === null || _extraInfo$addonAfter4 === void 0 ? void 0 : _extraInfo$addonAfter4.value) || []).map(function (v) {
|
110
|
+
return /*#__PURE__*/React.createElement(_Select.Option, {
|
111
|
+
key: v,
|
112
|
+
value: v
|
113
|
+
}, v);
|
114
|
+
}))) : undefined,
|
101
115
|
disabled: (_extraInfo$disabled5 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled5 !== void 0 ? _extraInfo$disabled5 : disabled,
|
102
116
|
placeholder: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.placeholder,
|
103
|
-
allowClear: true
|
117
|
+
allowClear: true,
|
118
|
+
onChange: onChange
|
104
119
|
});
|
105
120
|
}
|
106
121
|
};
|
@@ -111,9 +126,12 @@ function Index(props) {
|
|
111
126
|
|
112
127
|
if ((extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$depend = extraInfo.depend) === null || _extraInfo$depend === void 0 ? void 0 : _extraInfo$depend.show) && !depend.show) {
|
113
128
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
114
|
-
}
|
129
|
+
} // ref引用的 应用类型是否展示成表单
|
130
|
+
|
115
131
|
|
116
132
|
if (isObj && isRefForm && field) {
|
133
|
+
var _extraInfo$addonAfter5;
|
134
|
+
|
117
135
|
return /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
|
118
136
|
style: {
|
119
137
|
flex: 1,
|
@@ -124,7 +142,7 @@ function Index(props) {
|
|
124
142
|
color: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color
|
125
143
|
} : {}
|
126
144
|
}, (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
|
127
|
-
name: [field === null || field === void 0 ? void 0 : field.name].concat(_toConsumableArray(name)),
|
145
|
+
name: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$addonAfter5 = extraInfo.addonAfter) === null || _extraInfo$addonAfter5 === void 0 ? void 0 : _extraInfo$addonAfter5.key) ? [field === null || field === void 0 ? void 0 : field.name].concat(_toConsumableArray(name), ['value']) : [field === null || field === void 0 ? void 0 : field.name].concat(_toConsumableArray(name)),
|
128
146
|
rules: [{
|
129
147
|
required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
|
130
148
|
}].concat(_toConsumableArray(rules)),
|
@@ -133,7 +151,10 @@ function Index(props) {
|
|
133
151
|
}), processInputType((extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.type) || ''));
|
134
152
|
}
|
135
153
|
|
136
|
-
return !field ?
|
154
|
+
return !field ?
|
155
|
+
/*#__PURE__*/
|
156
|
+
// 不是引用的
|
157
|
+
React.createElement(_Form.Item, {
|
137
158
|
key: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.defaultValue,
|
138
159
|
initialValue: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.defaultValue,
|
139
160
|
style: {
|
@@ -144,7 +165,7 @@ function Index(props) {
|
|
144
165
|
color: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.color
|
145
166
|
} : {}
|
146
167
|
}, (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id),
|
147
|
-
name: name,
|
168
|
+
name: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$addonAfter6 = extraInfo.addonAfter) === null || _extraInfo$addonAfter6 === void 0 ? void 0 : _extraInfo$addonAfter6.key) ? [].concat(_toConsumableArray(name), ['value']) : name,
|
148
169
|
rules: [{
|
149
170
|
required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
|
150
171
|
}].concat(_toConsumableArray(rules)),
|
@@ -3,6 +3,10 @@ import _Form from "antd/es/form";
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
4
4
|
import "antd/es/radio/style";
|
5
5
|
import _Radio from "antd/es/radio";
|
6
|
+
import "antd/es/row/style";
|
7
|
+
import _Row from "antd/es/row";
|
8
|
+
import "antd/es/col/style";
|
9
|
+
import _Col from "antd/es/col";
|
6
10
|
import "antd/es/checkbox/style";
|
7
11
|
import _Checkbox from "antd/es/checkbox";
|
8
12
|
import "antd/es/select/style";
|
@@ -27,7 +31,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
27
31
|
/*
|
28
32
|
* @Author:wangxian
|
29
33
|
* @Date: 2021-09-18 14:15:04
|
30
|
-
* @LastEditTime: 2023-02-14
|
34
|
+
* @LastEditTime: 2023-02-14 16:38:38
|
31
35
|
*/
|
32
36
|
import React from 'react';
|
33
37
|
import { MetadataFormContext, MetadataRefContext } from '../interface';
|
@@ -375,19 +379,29 @@ function Index(props) {
|
|
375
379
|
style: {
|
376
380
|
width: '100%'
|
377
381
|
}
|
378
|
-
}, (httpOptions && httpOptions.length > 0 ? httpOptions : options).map(function (it) {
|
379
|
-
|
382
|
+
}, /*#__PURE__*/React.createElement(_Row, null, (httpOptions && httpOptions.length > 0 ? httpOptions : options).map(function (it) {
|
383
|
+
var _extraInfo$checkbox;
|
384
|
+
|
385
|
+
return /*#__PURE__*/React.createElement(_Col, {
|
386
|
+
key: it.value,
|
387
|
+
span: extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$checkbox = extraInfo.checkbox) === null || _extraInfo$checkbox === void 0 ? void 0 : _extraInfo$checkbox.colSpan
|
388
|
+
}, /*#__PURE__*/React.createElement(_Checkbox, {
|
380
389
|
value: it.value
|
381
|
-
}, it.label);
|
382
|
-
})) : /*#__PURE__*/React.createElement(_Radio.Group, {
|
390
|
+
}, it.label));
|
391
|
+
}))) : /*#__PURE__*/React.createElement(_Radio.Group, {
|
383
392
|
style: {
|
384
393
|
width: '100%'
|
385
394
|
}
|
386
|
-
}, (httpOptions && httpOptions.length > 0 ? httpOptions : options).map(function (it) {
|
387
|
-
|
395
|
+
}, /*#__PURE__*/React.createElement(_Row, null, (httpOptions && httpOptions.length > 0 ? httpOptions : options).map(function (it) {
|
396
|
+
var _extraInfo$checkbox2;
|
397
|
+
|
398
|
+
return /*#__PURE__*/React.createElement(_Col, {
|
399
|
+
key: it.value,
|
400
|
+
span: extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$checkbox2 = extraInfo.checkbox) === null || _extraInfo$checkbox2 === void 0 ? void 0 : _extraInfo$checkbox2.colSpan
|
401
|
+
}, /*#__PURE__*/React.createElement(_Radio, {
|
388
402
|
value: it.value
|
389
|
-
}, it.label);
|
390
|
-
}));
|
403
|
+
}, it.label));
|
404
|
+
})));
|
391
405
|
} else {
|
392
406
|
var _extraInfo$disabled3;
|
393
407
|
|
@@ -9,7 +9,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
9
9
|
/*
|
10
10
|
* @Author: wangxian
|
11
11
|
* @Date: 2021-09-18 14:15:04
|
12
|
-
* @LastEditTime: 2023-02-
|
12
|
+
* @LastEditTime: 2023-02-14 17:26:21
|
13
13
|
*/
|
14
14
|
import React from 'react';
|
15
15
|
import Input from './DataCell/Input';
|
@@ -88,6 +88,7 @@ export function renderForm(schemaRef, options) {
|
|
88
88
|
}
|
89
89
|
|
90
90
|
_form.push( /*#__PURE__*/React.createElement(_Col, {
|
91
|
+
key: _properties[i].id,
|
91
92
|
span: _colSpan
|
92
93
|
}, getDataCell(_properties[i], options)));
|
93
94
|
}
|
@@ -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
@@ -6,6 +6,7 @@
|
|
6
6
|
--ronds-metadata-color-bg-4: #1c3771;
|
7
7
|
--ronds-metadata-color-text-1: #ffffff;
|
8
8
|
--ronds-metadata-color-text-2: #ffffff;
|
9
|
+
--ronds-metadata-color-text-3: #ffffff;
|
9
10
|
|
10
11
|
::-webkit-scrollbar {
|
11
12
|
width: 6px;
|
@@ -45,6 +46,7 @@
|
|
45
46
|
--ronds-metadata-color-bg-4: #ffffff;
|
46
47
|
--ronds-metadata-color-text-1: #1d2129;
|
47
48
|
--ronds-metadata-color-text-2: #24292f;
|
49
|
+
--ronds-metadata-color-text-3: #f2f3f5;
|
48
50
|
|
49
51
|
::-webkit-scrollbar {
|
50
52
|
width: 6px;
|
package/package.json
CHANGED
@@ -1,94 +1,94 @@
|
|
1
|
-
{
|
2
|
-
"public": true,
|
3
|
-
"name": "ronds-metadata",
|
4
|
-
"version": "1.1.
|
5
|
-
"scripts": {
|
6
|
-
"start": "dumi dev",
|
7
|
-
"docs:build": "dumi build",
|
8
|
-
"docs:deploy": "gh-pages -d docs-dist",
|
9
|
-
"build": "father-build",
|
10
|
-
"deploy": "npm run docs:build && npm run docs:deploy",
|
11
|
-
"release": "npm run build && npm publish",
|
12
|
-
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
|
13
|
-
"test": "umi-test",
|
14
|
-
"test:coverage": "umi-test --coverage",
|
15
|
-
"prepublishOnly": "npm run build"
|
16
|
-
},
|
17
|
-
"main": "es",
|
18
|
-
"module": "es",
|
19
|
-
"types": "es/index.d.ts",
|
20
|
-
"gitHooks": {
|
21
|
-
"pre-commit": "lint-staged"
|
22
|
-
},
|
23
|
-
"lint-staged": {
|
24
|
-
"*.{js,jsx,less,md,json}": [
|
25
|
-
"prettier --write"
|
26
|
-
],
|
27
|
-
"*.ts?(x)": [
|
28
|
-
"prettier --parser=typescript --write"
|
29
|
-
]
|
30
|
-
},
|
31
|
-
"files": [
|
32
|
-
"/es"
|
33
|
-
],
|
34
|
-
"dependencies": {
|
35
|
-
"@antv/x6": "^1.32.2",
|
36
|
-
"@antv/x6-react-shape": "^1.6.0",
|
37
|
-
"@babel/helper-create-regexp-features-plugin": "^7.12.13",
|
38
|
-
"@babel/runtime": "^7.11.2",
|
39
|
-
"@popperjs/core": "^2.4.4",
|
40
|
-
"@types/markdown-navbar": "^1.4.0",
|
41
|
-
"ahooks": "^3.4.0",
|
42
|
-
"axios": "^0.21.4",
|
43
|
-
"babel-plugin-import": "^1.13.3",
|
44
|
-
"babel-plugin-transform-remove-console": "^6.9.4",
|
45
|
-
"bl": "^5.0.0",
|
46
|
-
"codemirror": "^5.63.0",
|
47
|
-
"codepage": "^1.15.0",
|
48
|
-
"github-markdown-css": "^5.1.0",
|
49
|
-
"immer": "^9.0.14",
|
50
|
-
"lodash": "^4.17.21",
|
51
|
-
"markdown-navbar": "^1.4.3",
|
52
|
-
"qs": "^6.10.1",
|
53
|
-
"react": "^17.0.2",
|
54
|
-
"react-dnd": "^11.1.3",
|
55
|
-
"react-dnd-html5-backend": "^11.1.3",
|
56
|
-
"react-jexcel": "^1.0.2",
|
57
|
-
"react-markdown": "^8.0.3",
|
58
|
-
"react-markdown-editor-lite": "^1.3.2",
|
59
|
-
"react-popper": "^2.2.3",
|
60
|
-
"react-syntax-highlighter": "^15.5.0",
|
61
|
-
"rehype-raw": "^6.1.1",
|
62
|
-
"remark-gfm": "^3.0.1",
|
63
|
-
"rxjs": "^7.5.4",
|
64
|
-
"xlsx": "^0.18.5"
|
65
|
-
},
|
66
|
-
"peerDependencies": {
|
67
|
-
"antd": ">=4.1.5",
|
68
|
-
"react": ">=16.14.0",
|
69
|
-
"react-dom": ">=16.14.0",
|
70
|
-
"react-router": ">=5.0.0",
|
71
|
-
"styled-components": ">=4.1.1"
|
72
|
-
},
|
73
|
-
"devDependencies": {
|
74
|
-
"@types/react": "^17.0.2",
|
75
|
-
"@types/react-dom": "^17.0.2",
|
76
|
-
"@types/react-router": "^5.1.8",
|
77
|
-
"@types/react-window": "^1.8.2",
|
78
|
-
"@types/styled-components": "^5.1.2",
|
79
|
-
"@umijs/test": "^3.0.5",
|
80
|
-
"antd": "^4.18.1",
|
81
|
-
"babel-loader": "^8.1.0",
|
82
|
-
"copy-to-clipboard": "^3.3.1",
|
83
|
-
"css-loader": "^4.2.2",
|
84
|
-
"dumi": "^1.0.16",
|
85
|
-
"father-build": "^1.17.2",
|
86
|
-
"gh-pages": "^3.0.0",
|
87
|
-
"less-loader": "^7.0.0",
|
88
|
-
"lint-staged": "^10.0.7",
|
89
|
-
"prettier": "^2.2.1",
|
90
|
-
"style-loader": "^1.2.1",
|
91
|
-
"webpack-cli": "^3.3.12",
|
92
|
-
"yorkie": "^2.0.0"
|
93
|
-
}
|
94
|
-
}
|
1
|
+
{
|
2
|
+
"public": true,
|
3
|
+
"name": "ronds-metadata",
|
4
|
+
"version": "1.1.93",
|
5
|
+
"scripts": {
|
6
|
+
"start": "dumi dev",
|
7
|
+
"docs:build": "dumi build",
|
8
|
+
"docs:deploy": "gh-pages -d docs-dist",
|
9
|
+
"build": "father-build",
|
10
|
+
"deploy": "npm run docs:build && npm run docs:deploy",
|
11
|
+
"release": "npm run build && npm publish",
|
12
|
+
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
|
13
|
+
"test": "umi-test",
|
14
|
+
"test:coverage": "umi-test --coverage",
|
15
|
+
"prepublishOnly": "npm run build"
|
16
|
+
},
|
17
|
+
"main": "es",
|
18
|
+
"module": "es",
|
19
|
+
"types": "es/index.d.ts",
|
20
|
+
"gitHooks": {
|
21
|
+
"pre-commit": "lint-staged"
|
22
|
+
},
|
23
|
+
"lint-staged": {
|
24
|
+
"*.{js,jsx,less,md,json}": [
|
25
|
+
"prettier --write"
|
26
|
+
],
|
27
|
+
"*.ts?(x)": [
|
28
|
+
"prettier --parser=typescript --write"
|
29
|
+
]
|
30
|
+
},
|
31
|
+
"files": [
|
32
|
+
"/es"
|
33
|
+
],
|
34
|
+
"dependencies": {
|
35
|
+
"@antv/x6": "^1.32.2",
|
36
|
+
"@antv/x6-react-shape": "^1.6.0",
|
37
|
+
"@babel/helper-create-regexp-features-plugin": "^7.12.13",
|
38
|
+
"@babel/runtime": "^7.11.2",
|
39
|
+
"@popperjs/core": "^2.4.4",
|
40
|
+
"@types/markdown-navbar": "^1.4.0",
|
41
|
+
"ahooks": "^3.4.0",
|
42
|
+
"axios": "^0.21.4",
|
43
|
+
"babel-plugin-import": "^1.13.3",
|
44
|
+
"babel-plugin-transform-remove-console": "^6.9.4",
|
45
|
+
"bl": "^5.0.0",
|
46
|
+
"codemirror": "^5.63.0",
|
47
|
+
"codepage": "^1.15.0",
|
48
|
+
"github-markdown-css": "^5.1.0",
|
49
|
+
"immer": "^9.0.14",
|
50
|
+
"lodash": "^4.17.21",
|
51
|
+
"markdown-navbar": "^1.4.3",
|
52
|
+
"qs": "^6.10.1",
|
53
|
+
"react": "^17.0.2",
|
54
|
+
"react-dnd": "^11.1.3",
|
55
|
+
"react-dnd-html5-backend": "^11.1.3",
|
56
|
+
"react-jexcel": "^1.0.2",
|
57
|
+
"react-markdown": "^8.0.3",
|
58
|
+
"react-markdown-editor-lite": "^1.3.2",
|
59
|
+
"react-popper": "^2.2.3",
|
60
|
+
"react-syntax-highlighter": "^15.5.0",
|
61
|
+
"rehype-raw": "^6.1.1",
|
62
|
+
"remark-gfm": "^3.0.1",
|
63
|
+
"rxjs": "^7.5.4",
|
64
|
+
"xlsx": "^0.18.5"
|
65
|
+
},
|
66
|
+
"peerDependencies": {
|
67
|
+
"antd": ">=4.1.5",
|
68
|
+
"react": ">=16.14.0",
|
69
|
+
"react-dom": ">=16.14.0",
|
70
|
+
"react-router": ">=5.0.0",
|
71
|
+
"styled-components": ">=4.1.1"
|
72
|
+
},
|
73
|
+
"devDependencies": {
|
74
|
+
"@types/react": "^17.0.2",
|
75
|
+
"@types/react-dom": "^17.0.2",
|
76
|
+
"@types/react-router": "^5.1.8",
|
77
|
+
"@types/react-window": "^1.8.2",
|
78
|
+
"@types/styled-components": "^5.1.2",
|
79
|
+
"@umijs/test": "^3.0.5",
|
80
|
+
"antd": "^4.18.1",
|
81
|
+
"babel-loader": "^8.1.0",
|
82
|
+
"copy-to-clipboard": "^3.3.1",
|
83
|
+
"css-loader": "^4.2.2",
|
84
|
+
"dumi": "^1.0.16",
|
85
|
+
"father-build": "^1.17.2",
|
86
|
+
"gh-pages": "^3.0.0",
|
87
|
+
"less-loader": "^7.0.0",
|
88
|
+
"lint-staged": "^10.0.7",
|
89
|
+
"prettier": "^2.2.1",
|
90
|
+
"style-loader": "^1.2.1",
|
91
|
+
"webpack-cli": "^3.3.12",
|
92
|
+
"yorkie": "^2.0.0"
|
93
|
+
}
|
94
|
+
}
|