ronds-metadata 1.2.38 → 1.2.39
Sign up to get free protection for your applications and to get access to all the features.
- package/es/api/index.js +83 -131
- package/es/comps/DynamicPorts/comps/ContextMenu.js +3 -11
- package/es/comps/DynamicPorts/comps/DragNode.js +2 -7
- package/es/comps/DynamicPorts/comps/GraphHandler/index.js +4 -5
- package/es/comps/DynamicPorts/comps/NodeElement.js +1 -4
- package/es/comps/DynamicPorts/comps/contextMenu/EdgeContextMenu/index.js +3 -6
- package/es/comps/DynamicPorts/comps/contextMenu/GraphContextMenu/index.js +3 -7
- package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.js +18 -21
- package/es/comps/DynamicPorts/comps/shape/edge.js +5 -18
- package/es/comps/DynamicPorts/comps/shape/node.js +4 -17
- package/es/comps/DynamicPorts/constant/index.js +2 -5
- package/es/comps/DynamicPorts/graph.d.ts +2 -2
- package/es/comps/DynamicPorts/graph.js +228 -312
- package/es/comps/DynamicPorts/index.js +39 -58
- package/es/comps/DynamicPorts/utils.js +21 -25
- package/es/comps/Editable/DataCell/ButtonCell.js +4 -10
- package/es/comps/Editable/DataCell/ColorPicker.js +2 -7
- package/es/comps/Editable/DataCell/Input.js +5 -14
- package/es/comps/Editable/DataCell/Number.js +3 -10
- package/es/comps/Editable/DataCell/Select.js +7 -14
- package/es/comps/Editable/DataCell/Switch.js +2 -7
- package/es/comps/Editable/comps/EditableAction.js +8 -12
- package/es/comps/Editable/comps/EditableCell.js +16 -26
- package/es/comps/Editable/comps/EditableHeardCell.js +21 -34
- package/es/comps/Editable/comps/EditableRow.js +49 -59
- package/es/comps/Editable/comps/Texty.js +36 -72
- package/es/comps/Editable/index.js +67 -112
- package/es/comps/Editable/interface.d.ts +1 -1
- package/es/comps/Editable/utils.js +0 -1
- package/es/comps/FileView/index.js +65 -101
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Checkbox.js +8 -13
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Color.js +8 -4
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Date.js +6 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Input.js +8 -4
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/List.js +6 -11
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/MutiSelect.js +6 -10
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Number.js +6 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Obj.js +6 -11
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Password.js +8 -4
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Radio.js +8 -13
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Select.js +6 -10
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Switch.js +6 -2
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Table.js +6 -11
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/TextArea.js +6 -3
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Upload.js +2 -5
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/HOC/index.js +86 -109
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/index.js +3 -7
- package/es/comps/FormGenerator/comps/Canvas/core/index.js +54 -91
- package/es/comps/FormGenerator/comps/Canvas/core/index.less +23 -23
- package/es/comps/FormGenerator/comps/Canvas/index.js +8 -15
- package/es/comps/FormGenerator/comps/Settings/index.js +16 -30
- package/es/comps/FormGenerator/comps/Sidebar/Elements.js +23 -22
- package/es/comps/FormGenerator/comps/Sidebar/index.js +6 -2
- package/es/comps/FormGenerator/index.js +3 -9
- package/es/comps/FormGenerator/interface.d.ts +1 -1
- package/es/comps/FormGenerator/settings/index.js +12 -11
- package/es/comps/FormGenerator/settings/ruleConfig.js +0 -1
- package/es/comps/FormGenerator/transformer.js +40 -105
- package/es/comps/Icons/index.js +4 -7
- package/es/comps/JsonEdit/index.js +25 -50
- package/es/comps/JsonView/index.js +7 -21
- package/es/comps/JsonView/index.less +41 -41
- package/es/comps/MdEdit/index.js +7 -10
- package/es/comps/MdEdit/index.less +6 -6
- package/es/comps/MdEditPro/index.d.ts +10 -0
- package/es/comps/MdEditPro/index.js +22 -0
- package/es/comps/MdEditPro/index.less +74 -0
- package/es/comps/MdNavbar/index.js +17 -40
- package/es/comps/MdNavbar/utils.js +0 -4
- package/es/comps/MdView/index.js +7 -11
- package/es/comps/MdView/index.less +353 -353
- package/es/comps/MetadataEdit/components/MetaFieldsEdit.js +129 -183
- package/es/comps/MetadataEdit/components/MetaPropsEdit.js +11 -27
- package/es/comps/MetadataEdit/hooks/index.js +3 -11
- package/es/comps/MetadataEdit/index.js +25 -58
- package/es/comps/MetadataEdit/index.less +10 -10
- package/es/comps/MetadataEdit/type.d.ts +20 -20
- package/es/comps/MetadataEditV2/components/MetaFieldsEdit.js +17 -33
- package/es/comps/MetadataEditV2/components/MetaPropsEdit.js +15 -29
- package/es/comps/MetadataEditV2/hooks/index.js +5 -12
- package/es/comps/MetadataEditV2/index.js +30 -65
- package/es/comps/MetadataForm/DataCell/Array.js +12 -23
- package/es/comps/MetadataForm/DataCell/Input.js +12 -32
- package/es/comps/MetadataForm/DataCell/Number.js +10 -21
- package/es/comps/MetadataForm/DataCell/Ref.js +87 -121
- package/es/comps/MetadataForm/DataCell/Select.js +127 -222
- package/es/comps/MetadataForm/DataCell/Switch.js +7 -14
- package/es/comps/MetadataForm/DataCell/layout/TableArray.js +93 -164
- package/es/comps/MetadataForm/HOC/index.js +20 -37
- package/es/comps/MetadataForm/HOC/index.less +41 -41
- package/es/comps/MetadataForm/hooks/index.js +12 -38
- package/es/comps/MetadataForm/index.js +37 -72
- package/es/comps/MetadataForm/interface.d.ts +3 -3
- package/es/comps/MetadataForm/utils.js +0 -14
- package/es/comps/Split/index.js +20 -22
- package/es/config.js +0 -4
- package/es/framework/RxStore/demo/index.js +9 -10
- package/es/framework/RxStore/hooks.d.ts +9 -9
- package/es/framework/RxStore/hooks.js +10 -35
- package/es/framework/RxStore/store.d.ts +4 -4
- package/es/framework/RxStore/store.js +0 -10
- package/es/framework/fg/index.js +18 -80
- package/es/framework/fg/interface.d.ts +2 -2
- package/es/framework/fg/utils.js +0 -10
- package/es/framework/graph/index.d.ts +2 -2
- package/es/framework/graph/index.js +55 -110
- package/es/framework/hooks/use-async-memo.js +3 -7
- package/es/framework/hooks/use-sync-scroll.js +2 -15
- package/es/framework/http/cache.js +25 -32
- package/es/framework/http/cancel.js +1 -7
- package/es/framework/http/index.js +22 -82
- package/es/framework/http/msgpack.js +0 -4
- package/es/framework/http/msgpack5/index.js +2 -12
- package/es/framework/http/msgpack5/lib/codecs/DateCodec.js +1 -13
- package/es/framework/http/msgpack5/lib/decoder.js +10 -68
- package/es/framework/http/msgpack5/lib/encoder.js +8 -36
- package/es/framework/http/msgpack5/lib/helpers.js +3 -2
- package/es/framework/http/msgpack5/lib/streams.js +0 -18
- package/es/framework/libs/jquery.min.js +1009 -1696
- package/es/framework/locale/dil8/di18n.js +4 -15
- package/es/framework/locale/dil8/translate.js +0 -14
- package/es/framework/locale/dil8/util.js +0 -3
- package/es/framework/locale/index.js +2 -3
- package/es/framework/metadata/MetadataService.js +39 -78
- package/es/framework/metadata/index.js +4 -70
- package/es/framework/metadata/types.d.ts +98 -98
- package/es/framework/rxjs-hooks/useMemoSubject.js +0 -2
- package/es/framework/rxjs-hooks/useObservable.js +2 -4
- package/es/framework/rxjs-hooks/useObservableState.js +8 -14
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/theme.less +79 -79
- package/es/utils.js +58 -97
- package/package.json +104 -102
@@ -11,9 +11,9 @@ import "antd/es/button/style";
|
|
11
11
|
import _Button from "antd/es/button";
|
12
12
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
13
13
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
14
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
15
14
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
16
15
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
16
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
17
17
|
import React from 'react';
|
18
18
|
import { CaretDownOutlined, CaretUpOutlined } from '@ant-design/icons';
|
19
19
|
import { MetadataService } from '../../../framework/metadata/MetadataService';
|
@@ -21,88 +21,72 @@ import { MetadataFormContext, MetadataRefContext } from '../interface';
|
|
21
21
|
import { useGetExtraInfo } from '../hooks';
|
22
22
|
import { renderForm } from '../utils';
|
23
23
|
import { JsonMetadataProvider } from '../../../framework/metadata';
|
24
|
-
|
25
24
|
function Index(props) {
|
26
25
|
var _extraInfo$disabled, _extraInfo$disabled2;
|
27
|
-
|
28
26
|
var id = props.id,
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
27
|
+
refId = props.refId,
|
28
|
+
disabled = props.disabled,
|
29
|
+
isRefForm = props.isRefForm,
|
30
|
+
fieldRule = props.fields,
|
31
|
+
labelSpan = props.labelSpan,
|
32
|
+
initEnumValue = props.initEnumValue,
|
33
|
+
field = props.field,
|
34
|
+
name = props.name;
|
37
35
|
var formContext = React.useContext(MetadataFormContext) || {};
|
38
|
-
var extraInfo = useGetExtraInfo(formContext.fields, id, formContext.form, props.type);
|
39
|
-
|
36
|
+
var extraInfo = useGetExtraInfo(formContext.fields, id, formContext.form, props.type);
|
37
|
+
// 是否折叠
|
40
38
|
var _React$useState = React.useState(true),
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
39
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
40
|
+
isFold = _React$useState2[0],
|
41
|
+
setIsFold = _React$useState2[1];
|
45
42
|
var _React$useState3 = React.useState([]),
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
43
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
44
|
+
schema = _React$useState4[0],
|
45
|
+
setSchema = _React$useState4[1];
|
50
46
|
var _React$useState5 = React.useState({}),
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
47
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
48
|
+
refFields = _React$useState6[0],
|
49
|
+
setRefFields = _React$useState6[1];
|
55
50
|
var refFieldsRef = React.useRef(refFields);
|
56
|
-
|
57
51
|
var _React$useState7 = React.useState([]),
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
52
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
53
|
+
options = _React$useState8[0],
|
54
|
+
setOptions = _React$useState8[1];
|
62
55
|
var _React$useState9 = React.useState(''),
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
56
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
57
|
+
help = _React$useState10[0],
|
58
|
+
setHelp = _React$useState10[1];
|
67
59
|
var onSearch = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
68
60
|
var param, server, res, _options, i, obj;
|
69
|
-
|
70
61
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
71
|
-
while (1) {
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
value: res[i].namespace
|
94
|
-
};
|
95
|
-
|
96
|
-
_options.push(obj);
|
97
|
-
}
|
62
|
+
while (1) switch (_context.prev = _context.next) {
|
63
|
+
case 0:
|
64
|
+
param = {
|
65
|
+
id: refId,
|
66
|
+
filter: {
|
67
|
+
keywords: ''
|
68
|
+
},
|
69
|
+
order: []
|
70
|
+
};
|
71
|
+
server = new MetadataService();
|
72
|
+
_context.next = 4;
|
73
|
+
return server.GetMetadataObjList(param);
|
74
|
+
case 4:
|
75
|
+
res = _context.sent;
|
76
|
+
_options = [];
|
77
|
+
if (res.length > 0) {
|
78
|
+
for (i = 0; i < res.length; i++) {
|
79
|
+
obj = {
|
80
|
+
label: res[i].name,
|
81
|
+
value: res[i].namespace
|
82
|
+
};
|
83
|
+
_options.push(obj);
|
98
84
|
}
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
return _context.stop();
|
105
|
-
}
|
85
|
+
}
|
86
|
+
setOptions(_options);
|
87
|
+
case 8:
|
88
|
+
case "end":
|
89
|
+
return _context.stop();
|
106
90
|
}
|
107
91
|
}, _callee);
|
108
92
|
})), []);
|
@@ -125,56 +109,44 @@ function Index(props) {
|
|
125
109
|
var getSchemaByRefId = React.useCallback( /*#__PURE__*/function () {
|
126
110
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(server, __TYPE__) {
|
127
111
|
var _schema, res, provider, FormCls, formCls, _fields;
|
128
|
-
|
129
112
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
130
|
-
while (1) {
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
_fields = formCls.__type__.__fields__;
|
165
|
-
refFieldsRef.current = _fields;
|
166
|
-
setRefFields(_objectSpread({}, _fields));
|
167
|
-
setSchema(_toConsumableArray(_schema));
|
168
|
-
}
|
169
|
-
|
170
|
-
case 9:
|
171
|
-
case "end":
|
172
|
-
return _context2.stop();
|
173
|
-
}
|
113
|
+
while (1) switch (_context2.prev = _context2.next) {
|
114
|
+
case 0:
|
115
|
+
_schema = []; // 如果有内部类,优先在内部类里面找
|
116
|
+
if (__TYPE__.length > 0) {
|
117
|
+
_schema = __TYPE__.filter(function (it) {
|
118
|
+
return it.id === refId;
|
119
|
+
});
|
120
|
+
}
|
121
|
+
// 内部类找不到 从接口里面拿
|
122
|
+
if (!(_schema.length === 0)) {
|
123
|
+
_context2.next = 7;
|
124
|
+
break;
|
125
|
+
}
|
126
|
+
_context2.next = 5;
|
127
|
+
return server.GetMetadataDetailById(refId);
|
128
|
+
case 5:
|
129
|
+
res = _context2.sent;
|
130
|
+
if (res === null || res === void 0 ? void 0 : res.schema) {
|
131
|
+
_schema = JSON.parse(res === null || res === void 0 ? void 0 : res.schema);
|
132
|
+
}
|
133
|
+
case 7:
|
134
|
+
provider = new JsonMetadataProvider();
|
135
|
+
if (_schema.length > 0) {
|
136
|
+
provider.add_types(_schema);
|
137
|
+
FormCls = provider.get_type(_schema[0].id);
|
138
|
+
formCls = new FormCls();
|
139
|
+
_fields = formCls.__type__.__fields__;
|
140
|
+
refFieldsRef.current = _fields;
|
141
|
+
setRefFields(_objectSpread({}, _fields));
|
142
|
+
setSchema(_toConsumableArray(_schema));
|
143
|
+
}
|
144
|
+
case 9:
|
145
|
+
case "end":
|
146
|
+
return _context2.stop();
|
174
147
|
}
|
175
148
|
}, _callee2);
|
176
149
|
}));
|
177
|
-
|
178
150
|
return function (_x, _x2) {
|
179
151
|
return _ref2.apply(this, arguments);
|
180
152
|
};
|
@@ -187,7 +159,6 @@ function Index(props) {
|
|
187
159
|
server = null;
|
188
160
|
};
|
189
161
|
}
|
190
|
-
|
191
162
|
return function () {};
|
192
163
|
}, [getSchemaByRefId, formContext.__TYPE__]);
|
193
164
|
React.useEffect(function () {
|
@@ -196,10 +167,8 @@ function Index(props) {
|
|
196
167
|
setHelp(arr[arr.length - 1]);
|
197
168
|
}
|
198
169
|
}, [refId]);
|
199
|
-
|
200
170
|
if (isRefForm && !field && schema.length > 0) {
|
201
171
|
var _fieldRule$, _fieldRule$$value, _fieldRule$2, _fieldRule$2$value, _fieldRule$2$value$co;
|
202
|
-
|
203
172
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Row, {
|
204
173
|
className: "ant-form-item"
|
205
174
|
}, !(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.titleHidden) && /*#__PURE__*/React.createElement(_Col, {
|
@@ -247,7 +216,6 @@ function Index(props) {
|
|
247
216
|
}
|
248
217
|
}, renderForm(schema, formOptions, formContext.colSpan))))));
|
249
218
|
}
|
250
|
-
|
251
219
|
if (isRefForm && field && schema.length > 0) {
|
252
220
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
253
221
|
style: {
|
@@ -263,7 +231,6 @@ function Index(props) {
|
|
263
231
|
}
|
264
232
|
}, renderForm(schema, formOptions, formContext.colSpan))));
|
265
233
|
}
|
266
|
-
|
267
234
|
return !field ? /*#__PURE__*/React.createElement(_Form.Item, {
|
268
235
|
key: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.defaultValue,
|
269
236
|
label: (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id,
|
@@ -322,5 +289,4 @@ function Index(props) {
|
|
322
289
|
allowClear: true
|
323
290
|
}));
|
324
291
|
}
|
325
|
-
|
326
292
|
export default /*#__PURE__*/React.memo(Index);
|