ronds-metadata 1.2.38 → 1.2.39
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/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
|
@@ -5,6 +5,11 @@ import _Button from "antd/es/button";
|
|
|
5
5
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
6
6
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
7
7
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
8
|
+
/*
|
|
9
|
+
* @Author: wangxian
|
|
10
|
+
* @Date: 2023-02-06 08:24:17
|
|
11
|
+
* @LastEditTime: 2023-03-25 10:24:38
|
|
12
|
+
*/
|
|
8
13
|
import React from 'react';
|
|
9
14
|
import copy from 'copy-to-clipboard';
|
|
10
15
|
import { FGCtx } from '../../Provider';
|
|
@@ -13,19 +18,16 @@ import { transFG2Schema } from '../../transformer';
|
|
|
13
18
|
import CanvasCore from './core';
|
|
14
19
|
import MetadataForm from '../../../../comps/MetadataForm';
|
|
15
20
|
import useObservable from '../../../../framework/rxjs-hooks/useObservable';
|
|
16
|
-
|
|
17
21
|
var Canvas = function Canvas() {
|
|
18
22
|
var nodesRef = React.useRef([]);
|
|
19
23
|
var settingRef = React.useRef({
|
|
20
24
|
formSetting: formSetting.param.defaultValue
|
|
21
25
|
});
|
|
22
26
|
var typesRef = React.useRef({});
|
|
23
|
-
|
|
24
27
|
var _React$useState = React.useState([]),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
29
|
+
schema = _React$useState2[0],
|
|
30
|
+
setSchema = _React$useState2[1];
|
|
29
31
|
var fGCtx = React.useContext(FGCtx) || {};
|
|
30
32
|
var processFgStreamData = React.useCallback(function (p) {
|
|
31
33
|
switch (p === null || p === void 0 ? void 0 : p.type) {
|
|
@@ -33,37 +35,30 @@ var Canvas = function Canvas() {
|
|
|
33
35
|
if (p === null || p === void 0 ? void 0 : p.payload) {
|
|
34
36
|
settingRef.current = p.payload.allSetting;
|
|
35
37
|
}
|
|
36
|
-
|
|
37
38
|
break;
|
|
38
|
-
|
|
39
39
|
case streamEventType.onTypesChange:
|
|
40
40
|
if (p === null || p === void 0 ? void 0 : p.payload) {
|
|
41
41
|
typesRef.current = _objectSpread(_objectSpread({}, typesRef.current), p === null || p === void 0 ? void 0 : p.payload);
|
|
42
42
|
}
|
|
43
|
-
|
|
44
43
|
break;
|
|
45
44
|
}
|
|
46
45
|
}, []);
|
|
47
46
|
useObservable(function (p) {
|
|
48
47
|
processFgStreamData(p);
|
|
49
48
|
}, [fGCtx.fgStream]);
|
|
50
|
-
|
|
51
49
|
var onClearCanvas = function onClearCanvas() {
|
|
52
50
|
fGCtx.fgStream && fGCtx.fgStream.next({
|
|
53
51
|
type: streamEventType.onClearCanvas
|
|
54
52
|
});
|
|
55
53
|
};
|
|
56
|
-
|
|
57
54
|
var onPreview = function onPreview() {
|
|
58
55
|
if (schema.length === 0) {
|
|
59
56
|
var _schema = transFG2Schema(nodesRef.current, settingRef.current, typesRef.current);
|
|
60
|
-
|
|
61
57
|
setSchema(_toConsumableArray(_schema || []));
|
|
62
58
|
} else {
|
|
63
59
|
setSchema([]);
|
|
64
60
|
}
|
|
65
61
|
};
|
|
66
|
-
|
|
67
62
|
return /*#__PURE__*/React.createElement("div", {
|
|
68
63
|
style: {
|
|
69
64
|
height: '100%',
|
|
@@ -88,7 +83,6 @@ var Canvas = function Canvas() {
|
|
|
88
83
|
type: "primary",
|
|
89
84
|
onClick: function onClick() {
|
|
90
85
|
var _schema = transFG2Schema(nodesRef.current, settingRef.current, typesRef.current);
|
|
91
|
-
|
|
92
86
|
if (copy(JSON.stringify(_schema))) {
|
|
93
87
|
_message.success("\u5DF2\u590D\u5236\u5230\u526A\u5207\u677F");
|
|
94
88
|
}
|
|
@@ -116,5 +110,4 @@ var Canvas = function Canvas() {
|
|
|
116
110
|
}
|
|
117
111
|
})));
|
|
118
112
|
};
|
|
119
|
-
|
|
120
113
|
export default Canvas;
|
|
@@ -3,37 +3,37 @@ import _Tabs from "antd/es/tabs";
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
5
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
|
+
/*
|
|
7
|
+
* @Author: uloveits 719310130@qq.com
|
|
8
|
+
* @Date: 2023-02-04 16:35:15
|
|
9
|
+
* @LastEditors: uloveits 719310130@qq.com
|
|
10
|
+
* @LastEditTime: 2023-04-04 19:34:22
|
|
11
|
+
*/
|
|
6
12
|
import React from 'react';
|
|
7
13
|
import { FGCtx } from '../../Provider';
|
|
8
14
|
import { formSetting, streamEventType } from '../../settings';
|
|
9
15
|
import MetadataForm from '../../../../comps/MetadataForm';
|
|
10
16
|
import useObservable from '../../../../framework/rxjs-hooks/useObservable';
|
|
11
|
-
|
|
12
17
|
var Settings = function Settings() {
|
|
13
18
|
var _curNode$param, _formSetting$param;
|
|
14
|
-
|
|
15
19
|
var fGCtx = React.useContext(FGCtx) || {};
|
|
16
20
|
var compFormRef = React.useRef();
|
|
17
21
|
var formRef = React.useRef();
|
|
18
|
-
|
|
19
22
|
var _React$useState = React.useState(),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
24
|
+
curNode = _React$useState2[0],
|
|
25
|
+
setCurNode = _React$useState2[1];
|
|
24
26
|
var _React$useState3 = React.useState(formSetting.id),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
28
|
+
curTab = _React$useState4[0],
|
|
29
|
+
setCurTab = _React$useState4[1];
|
|
29
30
|
var refIdRef = React.useRef();
|
|
30
31
|
var settingValueRef = React.useRef({
|
|
31
32
|
formSetting: formSetting.param.defaultValue
|
|
32
|
-
});
|
|
33
|
-
|
|
33
|
+
});
|
|
34
|
+
// 处理默认数据
|
|
34
35
|
var processDefaultValue = React.useCallback(function (data) {
|
|
35
36
|
var _data$settings;
|
|
36
|
-
|
|
37
37
|
settingValueRef.current = data.settings;
|
|
38
38
|
formRef.current.setFieldsValue(_objectSpread({}, (data === null || data === void 0 ? void 0 : (_data$settings = data.settings) === null || _data$settings === void 0 ? void 0 : _data$settings.formSetting) || {}));
|
|
39
39
|
fGCtx.fgStream && fGCtx.fgStream.next({
|
|
@@ -48,15 +48,12 @@ var Settings = function Settings() {
|
|
|
48
48
|
switch (p === null || p === void 0 ? void 0 : p.type) {
|
|
49
49
|
case streamEventType.onNodeSelect:
|
|
50
50
|
refIdRef.current = p === null || p === void 0 ? void 0 : p.payload.refId;
|
|
51
|
-
|
|
52
51
|
var _node = p === null || p === void 0 ? void 0 : p.payload.node;
|
|
53
|
-
|
|
54
52
|
setCurNode(_objectSpread({}, _node));
|
|
55
|
-
setCurTab(_node.id);
|
|
56
|
-
|
|
53
|
+
setCurTab(_node.id);
|
|
54
|
+
// 赋值
|
|
57
55
|
if (refIdRef.current) {
|
|
58
56
|
var _key = "".concat(refIdRef.current, "_ref");
|
|
59
|
-
|
|
60
57
|
if (settingValueRef.current[_key] && settingValueRef.current[_key][_node.id]) {
|
|
61
58
|
setTimeout(function () {
|
|
62
59
|
compFormRef.current && compFormRef.current.setFieldsValue(_objectSpread({}, settingValueRef.current[_key][_node.id]));
|
|
@@ -69,14 +66,11 @@ var Settings = function Settings() {
|
|
|
69
66
|
}, 100);
|
|
70
67
|
}
|
|
71
68
|
}
|
|
72
|
-
|
|
73
69
|
break;
|
|
74
|
-
|
|
75
70
|
case streamEventType.onClearCanvas:
|
|
76
71
|
setCurNode(undefined);
|
|
77
72
|
setCurTab('formSetting');
|
|
78
73
|
break;
|
|
79
|
-
|
|
80
74
|
case streamEventType.onDefaultValue:
|
|
81
75
|
processDefaultValue(p === null || p === void 0 ? void 0 : p.payload);
|
|
82
76
|
break;
|
|
@@ -85,32 +79,25 @@ var Settings = function Settings() {
|
|
|
85
79
|
useObservable(function (p) {
|
|
86
80
|
processFgStreamData(p);
|
|
87
81
|
}, [fGCtx.fgStream]);
|
|
88
|
-
|
|
89
82
|
var onTabChange = function onTabChange(key) {
|
|
90
83
|
setCurTab(key);
|
|
91
84
|
};
|
|
92
|
-
|
|
93
85
|
var _onValuesChange = function onValuesChange(id, val, allVals) {
|
|
94
86
|
var _payload;
|
|
95
|
-
|
|
96
87
|
var _settingValue = settingValueRef.current;
|
|
97
|
-
|
|
98
88
|
if (refIdRef.current && id !== formSetting.id) {
|
|
99
89
|
var _key = "".concat(refIdRef.current, "_ref");
|
|
100
|
-
|
|
101
90
|
_settingValue = settingValueRef.current[_key] ? settingValueRef.current : _objectSpread(_objectSpread({}, settingValueRef.current), {}, _defineProperty({}, _key, {}));
|
|
102
91
|
_settingValue[_key][id] = allVals;
|
|
103
92
|
} else {
|
|
104
93
|
_settingValue[id] = allVals;
|
|
105
94
|
}
|
|
106
|
-
|
|
107
95
|
settingValueRef.current = _settingValue;
|
|
108
96
|
fGCtx.fgStream && fGCtx.fgStream.next({
|
|
109
97
|
type: streamEventType.onSettingValueChange,
|
|
110
98
|
payload: (_payload = {}, _defineProperty(_payload, id, allVals), _defineProperty(_payload, "allSetting", settingValueRef.current), _defineProperty(_payload, "refId", refIdRef.current), _payload)
|
|
111
99
|
});
|
|
112
100
|
};
|
|
113
|
-
|
|
114
101
|
return /*#__PURE__*/React.createElement("div", {
|
|
115
102
|
style: {
|
|
116
103
|
height: '100%',
|
|
@@ -149,5 +136,4 @@ var Settings = function Settings() {
|
|
|
149
136
|
}
|
|
150
137
|
}))));
|
|
151
138
|
};
|
|
152
|
-
|
|
153
139
|
export default Settings;
|
|
@@ -2,32 +2,34 @@ import "antd/es/col/style";
|
|
|
2
2
|
import _Col from "antd/es/col";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
4
|
import React from "react";
|
|
5
|
+
/*
|
|
6
|
+
* @Author: uloveits 719310130@qq.com
|
|
7
|
+
* @Date: 2023-02-04 17:21:17
|
|
8
|
+
* @LastEditors: uloveits 719310130@qq.com
|
|
9
|
+
* @LastEditTime: 2023-02-27 10:48:02
|
|
10
|
+
*/
|
|
5
11
|
import { useDrag } from 'react-dnd';
|
|
6
12
|
import { dragItemType } from '../../settings';
|
|
7
|
-
|
|
8
13
|
var Elements = function Elements(props) {
|
|
9
14
|
var data = props.data;
|
|
10
|
-
|
|
11
15
|
var _useDrag = useDrag({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
drag = _useDrag2[1];
|
|
30
|
-
|
|
16
|
+
item: {
|
|
17
|
+
dragItem: data,
|
|
18
|
+
type: dragItemType
|
|
19
|
+
},
|
|
20
|
+
end: function end(item, monitor) {
|
|
21
|
+
var dropResult = monitor.getDropResult();
|
|
22
|
+
if (item && dropResult) {}
|
|
23
|
+
},
|
|
24
|
+
collect: function collect(monitor) {
|
|
25
|
+
return {
|
|
26
|
+
isDragging: monitor.isDragging()
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}),
|
|
30
|
+
_useDrag2 = _slicedToArray(_useDrag, 2),
|
|
31
|
+
isDragging = _useDrag2[0].isDragging,
|
|
32
|
+
drag = _useDrag2[1];
|
|
31
33
|
var opacity = isDragging ? 0.7 : 1;
|
|
32
34
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Col, {
|
|
33
35
|
span: 12,
|
|
@@ -44,5 +46,4 @@ var Elements = function Elements(props) {
|
|
|
44
46
|
}
|
|
45
47
|
}, data.name)));
|
|
46
48
|
};
|
|
47
|
-
|
|
48
49
|
export default Elements;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import "antd/es/row/style";
|
|
2
2
|
import _Row from "antd/es/row";
|
|
3
3
|
import React from "react";
|
|
4
|
+
/*
|
|
5
|
+
* @Author: uloveits 719310130@qq.com
|
|
6
|
+
* @Date: 2023-02-04 16:35:16
|
|
7
|
+
* @LastEditors: Please set LastEditors
|
|
8
|
+
* @LastEditTime: 2023-03-25 10:24:57
|
|
9
|
+
*/
|
|
4
10
|
import { sidebarCtx } from '../../settings';
|
|
5
11
|
import Elements from './Elements';
|
|
6
|
-
|
|
7
12
|
var Sidebar = function Sidebar() {
|
|
8
13
|
return /*#__PURE__*/React.createElement("div", {
|
|
9
14
|
style: {
|
|
@@ -33,5 +38,4 @@ var Sidebar = function Sidebar() {
|
|
|
33
38
|
})));
|
|
34
39
|
}));
|
|
35
40
|
};
|
|
36
|
-
|
|
37
41
|
export default Sidebar;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
-
|
|
4
3
|
/*
|
|
5
4
|
* @Author: wangxian
|
|
6
5
|
* @Date: 2023-02-04 13:45:31
|
|
@@ -19,16 +18,13 @@ import useMemoSubject from '../../framework/rxjs-hooks/useMemoSubject';
|
|
|
19
18
|
import useObservable from '../../framework/rxjs-hooks/useObservable';
|
|
20
19
|
import { streamEventType } from './settings';
|
|
21
20
|
import { transSchema2FG } from './transformer';
|
|
22
|
-
|
|
23
21
|
var FormGenerator = function FormGenerator(props) {
|
|
24
22
|
var defaultSchema = props.defaultSchema;
|
|
25
23
|
var FGStream = useMemoSubject();
|
|
26
|
-
|
|
27
24
|
var _React$useState = React.useState({}),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
26
|
+
types = _React$useState2[0],
|
|
27
|
+
setTypes = _React$useState2[1];
|
|
32
28
|
var typesRef = React.useRef({});
|
|
33
29
|
React.useEffect(function () {
|
|
34
30
|
if (defaultSchema) {
|
|
@@ -46,7 +42,6 @@ var FormGenerator = function FormGenerator(props) {
|
|
|
46
42
|
typesRef.current = _objectSpread(_objectSpread({}, typesRef.current), p === null || p === void 0 ? void 0 : p.payload);
|
|
47
43
|
setTypes(_objectSpread({}, typesRef.current));
|
|
48
44
|
}
|
|
49
|
-
|
|
50
45
|
break;
|
|
51
46
|
}
|
|
52
47
|
}, []);
|
|
@@ -68,5 +63,4 @@ var FormGenerator = function FormGenerator(props) {
|
|
|
68
63
|
gutterSize: 0
|
|
69
64
|
}, /*#__PURE__*/React.createElement(Sidebar, null), /*#__PURE__*/React.createElement(Canvas, null), /*#__PURE__*/React.createElement(Settings, null))))));
|
|
70
65
|
};
|
|
71
|
-
|
|
72
66
|
export default FormGenerator;
|
|
@@ -69,7 +69,7 @@ export declare namespace StreamEvent {
|
|
|
69
69
|
payload?: FG.IDefaultValue;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
export
|
|
72
|
+
export type IFGStream = StreamEvent.onNodeSelect | StreamEvent.onClearCanvas | StreamEvent.onNodeDelete | StreamEvent.onNodeCopy | StreamEvent.onSettingValueChange | StreamEvent.onDropOver | StreamEvent.onTypesChange | StreamEvent.onDefaultValue;
|
|
73
73
|
export interface IFGCtxProps {
|
|
74
74
|
fgStream?: BehaviorSubject<IFGStream | undefined>;
|
|
75
75
|
types?: {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
-
|
|
3
2
|
/*
|
|
4
3
|
* @Author: wangxian
|
|
5
4
|
* @Date: 2023-02-06 08:24:17
|
|
@@ -21,7 +20,8 @@ export var textareaSchema = [{
|
|
|
21
20
|
export var dateSchema = [{
|
|
22
21
|
id: 'dateSchema',
|
|
23
22
|
type: 'object',
|
|
24
|
-
properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan,
|
|
23
|
+
properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan,
|
|
24
|
+
// Rule.common.defaultValue,
|
|
25
25
|
Rule.common.help, Rule.common.tooltip, Rule.common.placeholder, Rule.common.require, Rule.common.disabled, Rule.common.br, Rule.common.hidden, RefRule.common.depend.props, RefRule.common.rules.props, RefRule.text.props],
|
|
26
26
|
types: [].concat(_toConsumableArray(RefRule.common.depend.types), _toConsumableArray(RefRule.text.types), _toConsumableArray(RefRule.common.rules.types))
|
|
27
27
|
}];
|
|
@@ -34,7 +34,8 @@ export var numberSchema = [{
|
|
|
34
34
|
export var switchSchema = [{
|
|
35
35
|
id: 'switchSchema',
|
|
36
36
|
type: 'object',
|
|
37
|
-
properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan,
|
|
37
|
+
properties: [Rule.common.id, Rule.common.label, Rule.common.color, Rule.common.colSpan,
|
|
38
|
+
// Rule.common.defaultValue,
|
|
38
39
|
Rule.common.help, Rule.common.tooltip, Rule.common.require, Rule.common.disabled, Rule.common.br, Rule.common.hidden, RefRule.common.depend.props],
|
|
39
40
|
types: _toConsumableArray(RefRule.common.depend.types)
|
|
40
41
|
}];
|
|
@@ -118,8 +119,8 @@ export var mutiSelectParam = {
|
|
|
118
119
|
rule: {
|
|
119
120
|
isMutiple: true
|
|
120
121
|
}
|
|
121
|
-
};
|
|
122
|
-
|
|
122
|
+
};
|
|
123
|
+
// 基础组件列表渲染
|
|
123
124
|
export var basicComps = [{
|
|
124
125
|
id: 'input',
|
|
125
126
|
name: '输入框',
|
|
@@ -190,8 +191,8 @@ export var radioParam = {
|
|
|
190
191
|
rule: {
|
|
191
192
|
type: 'checkbox'
|
|
192
193
|
}
|
|
193
|
-
};
|
|
194
|
-
|
|
194
|
+
};
|
|
195
|
+
// 基础组件列表渲染
|
|
195
196
|
export var complexComps = [{
|
|
196
197
|
id: 'color',
|
|
197
198
|
name: '颜色选择',
|
|
@@ -232,8 +233,8 @@ export var tableParam = {
|
|
|
232
233
|
rule: {
|
|
233
234
|
layout: 'table'
|
|
234
235
|
}
|
|
235
|
-
};
|
|
236
|
-
|
|
236
|
+
};
|
|
237
|
+
// 布局组件列表渲染
|
|
237
238
|
export var layoutComps = [{
|
|
238
239
|
id: 'obj',
|
|
239
240
|
name: '对象',
|
|
@@ -249,8 +250,8 @@ export var layoutComps = [{
|
|
|
249
250
|
name: '表格',
|
|
250
251
|
type: 'table',
|
|
251
252
|
param: tableParam
|
|
252
|
-
}];
|
|
253
|
-
|
|
253
|
+
}];
|
|
254
|
+
// Sidebar 内容配置
|
|
254
255
|
export var sidebarCtx = [{
|
|
255
256
|
name: '基础组件',
|
|
256
257
|
children: basicComps
|