ronds-metadata 1.2.80 → 1.2.82
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/DynamicPorts/comps/DragNode.d.ts +1 -1
- package/es/comps/DynamicPorts/comps/NodeElement.d.ts +1 -1
- package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.d.ts +2 -1
- package/es/comps/DynamicPorts/index.d.ts +2 -1
- package/es/comps/Editable/DataCell/ButtonCell.d.ts +1 -1
- package/es/comps/Editable/DataCell/ColorPicker.d.ts +1 -1
- package/es/comps/Editable/DataCell/Input.d.ts +1 -1
- package/es/comps/Editable/DataCell/Number.d.ts +1 -1
- package/es/comps/Editable/DataCell/Select.d.ts +1 -1
- package/es/comps/Editable/DataCell/Switch.d.ts +1 -1
- package/es/comps/Editable/comps/EditableAction.d.ts +2 -1
- package/es/comps/Editable/comps/Texty.d.ts +1 -1
- package/es/comps/Editable/index.d.ts +2 -1
- package/es/comps/Editable/utils.d.ts +2 -1
- package/es/comps/FileView/index.d.ts +2 -1
- package/es/comps/FormGenerator/comps/Canvas/Preview.d.ts +6 -0
- package/es/comps/FormGenerator/comps/Canvas/Preview.js +58 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Checkbox.d.ts +2 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Color.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Date.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Input.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/List.d.ts +2 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/MutiSelect.d.ts +2 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Number.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/NumberRange.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Obj.d.ts +2 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Password.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Radio.d.ts +2 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Select.d.ts +2 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Switch.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Table.d.ts +2 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/TextArea.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Upload.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/HOC/index.d.ts +2 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/index.d.ts +2 -1
- package/es/comps/FormGenerator/comps/Canvas/core/index.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Canvas/index.d.ts +2 -1
- package/es/comps/FormGenerator/comps/Canvas/index.js +28 -13
- package/es/comps/FormGenerator/comps/Settings/index.d.ts +2 -1
- package/es/comps/FormGenerator/comps/Sidebar/Elements.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Sidebar/JsonSchema.d.ts +1 -1
- package/es/comps/FormGenerator/comps/Sidebar/index.d.ts +2 -1
- package/es/comps/FormGenerator/comps/Sidebar/index.js +30 -4
- package/es/comps/FormGenerator/index.d.ts +2 -1
- package/es/comps/FormGenerator/interface.d.ts +5 -1
- package/es/comps/FormGenerator/interface.js +1 -1
- package/es/comps/FormGenerator/settings/index.d.ts +1 -0
- package/es/comps/FormGenerator/settings/index.js +3 -2
- package/es/comps/JsonEdit/index.d.ts +2 -1
- package/es/comps/JsonView/index.d.ts +2 -1
- package/es/comps/JsonView/index.less +41 -41
- package/es/comps/MdEdit/index.d.ts +2 -1
- package/es/comps/MdEdit/index.less +6 -6
- package/es/comps/MdEditPro/index.d.ts +2 -1
- package/es/comps/MdNavbar/index.d.ts +2 -1
- package/es/comps/MdView/index.d.ts +1 -1
- package/es/comps/MetadataEdit/components/MetaFieldsEdit.d.ts +2 -1
- package/es/comps/MetadataEdit/components/MetaPropsEdit.d.ts +2 -1
- package/es/comps/MetadataEdit/index.d.ts +2 -1
- package/es/comps/MetadataEdit/index.less +10 -10
- package/es/comps/MetadataEdit/type.d.ts +20 -20
- package/es/comps/MetadataEditV2/components/MetaFieldsEdit.d.ts +2 -1
- package/es/comps/MetadataEditV2/components/MetaPropsEdit.d.ts +2 -1
- package/es/comps/MetadataEditV2/index.d.ts +2 -1
- package/es/comps/MetadataForm/DataCell/Array.d.ts +1 -1
- package/es/comps/MetadataForm/DataCell/Input.d.ts +1 -1
- package/es/comps/MetadataForm/DataCell/Number.d.ts +1 -1
- package/es/comps/MetadataForm/DataCell/Ref.d.ts +1 -1
- package/es/comps/MetadataForm/DataCell/Select.d.ts +1 -1
- package/es/comps/MetadataForm/DataCell/Select.js +1 -1
- package/es/comps/MetadataForm/DataCell/Switch.d.ts +1 -1
- package/es/comps/MetadataForm/DataCell/layout/TableArray.d.ts +2 -1
- package/es/comps/MetadataForm/DataCell/plugin/NumberRange.d.ts +2 -1
- package/es/comps/MetadataForm/HOC/index.d.ts +2 -1
- package/es/comps/MetadataForm/HOC/index.less +41 -41
- package/es/comps/MetadataForm/index.d.ts +2 -1
- package/es/comps/MetadataForm/utils.d.ts +3 -2
- package/es/comps/Split/index.d.ts +1 -1
- package/es/framework/RxStore/demo/index.d.ts +2 -1
- package/es/framework/metadata/types.d.ts +98 -98
- package/es/utils.js +6 -4
- package/package.json +103 -103
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import './index.less';
|
|
2
3
|
interface INodeContextMenuProps {
|
|
3
4
|
graph: any;
|
|
4
5
|
data: any;
|
|
5
6
|
}
|
|
6
|
-
declare const NodeContextMenu: (props: INodeContextMenuProps) => JSX.Element;
|
|
7
|
+
declare const NodeContextMenu: (props: INodeContextMenuProps) => React.JSX.Element;
|
|
7
8
|
export default NodeContextMenu;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import './index.less';
|
|
2
3
|
import './comps/shape/connector';
|
|
3
4
|
import DPGraph from './graph';
|
|
@@ -20,5 +21,5 @@ interface IDynamicPortsProps {
|
|
|
20
21
|
*/
|
|
21
22
|
getDPGraphInstance?: (data: DPGraph) => void;
|
|
22
23
|
}
|
|
23
|
-
declare const DynamicPorts: (props: IDynamicPortsProps) => JSX.Element;
|
|
24
|
+
declare const DynamicPorts: (props: IDynamicPortsProps) => React.JSX.Element;
|
|
24
25
|
export default DynamicPorts;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EditableCellProps } from '../interface';
|
|
3
|
-
declare function Index(props: EditableCellProps): JSX.Element;
|
|
3
|
+
declare function Index(props: EditableCellProps): React.JSX.Element;
|
|
4
4
|
declare const _default: React.MemoExoticComponent<typeof Index>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EditableCellProps } from '../interface';
|
|
3
|
-
declare function Index(props: EditableCellProps): JSX.Element;
|
|
3
|
+
declare function Index(props: EditableCellProps): React.JSX.Element;
|
|
4
4
|
declare const _default: React.MemoExoticComponent<typeof Index>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EditableCellProps } from '../interface';
|
|
3
|
-
declare function Index(props: EditableCellProps): JSX.Element;
|
|
3
|
+
declare function Index(props: EditableCellProps): React.JSX.Element;
|
|
4
4
|
declare const _default: React.MemoExoticComponent<typeof Index>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EditableCellProps } from '../interface';
|
|
3
|
-
declare function Index(props: EditableCellProps): JSX.Element;
|
|
3
|
+
declare function Index(props: EditableCellProps): React.JSX.Element;
|
|
4
4
|
declare const _default: React.MemoExoticComponent<typeof Index>;
|
|
5
5
|
export default _default;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface IEditableActionProps {
|
|
2
3
|
type: 'single' | 'multiple' | 'freedom';
|
|
3
4
|
record: any;
|
|
4
5
|
}
|
|
5
|
-
declare const EditableAction: (props: IEditableActionProps) => JSX.Element;
|
|
6
|
+
declare const EditableAction: (props: IEditableActionProps) => React.JSX.Element;
|
|
6
7
|
export default EditableAction;
|
|
@@ -69,7 +69,7 @@ declare class Texty extends React.PureComponent<ITextyProps, any> {
|
|
|
69
69
|
private showTimer;
|
|
70
70
|
componentDidUpdate(): void;
|
|
71
71
|
componentWillUnmount(): void;
|
|
72
|
-
render(): JSX.Element;
|
|
72
|
+
render(): React.JSX.Element;
|
|
73
73
|
renderTooltip: ({ ref, style, placement, arrowProps }: any) => React.ReactPortal;
|
|
74
74
|
setTargetRef: (ref: any) => void;
|
|
75
75
|
handleMouseEvent: (e: any) => void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TableProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
import { BehaviorSubject } from 'rxjs';
|
|
3
4
|
import { EditColumnsType, IEditableStream } from './interface';
|
|
4
5
|
import './index.less';
|
|
@@ -74,5 +75,5 @@ interface IEditableProps<R = any> {
|
|
|
74
75
|
*/
|
|
75
76
|
getStreamInstance?: (subject: BehaviorSubject<IEditableStream | undefined>) => void;
|
|
76
77
|
}
|
|
77
|
-
declare const Editable: (props: IEditableProps) => JSX.Element;
|
|
78
|
+
declare const Editable: (props: IEditableProps) => React.JSX.Element;
|
|
78
79
|
export default Editable;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { EditableCellProps } from './interface';
|
|
2
|
-
export declare function getDataCell(item: EditableCellProps): JSX.Element;
|
|
3
|
+
export declare function getDataCell(item: EditableCellProps): React.JSX.Element;
|
|
3
4
|
export declare function isFreeEditRow(curRow: any, rowIndex: number): boolean;
|
|
4
5
|
export declare function isFreeEditCell(editCellKey: any, dataIndex: string, rowIndex: number): boolean;
|
|
5
6
|
export declare function isCellDisabled(record: any, cellDisabled?: string): boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface IFileViewProps {
|
|
2
3
|
/**
|
|
3
4
|
* 文件远程链接
|
|
@@ -16,5 +17,5 @@ interface IFileViewProps {
|
|
|
16
17
|
*/
|
|
17
18
|
limit?: number;
|
|
18
19
|
}
|
|
19
|
-
declare const FileView: (props: IFileViewProps) => JSX.Element;
|
|
20
|
+
declare const FileView: (props: IFileViewProps) => React.JSX.Element;
|
|
20
21
|
export default FileView;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import "antd/es/button/style";
|
|
2
|
+
import _Button from "antd/es/button";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
+
import MetadataForm from '@/comps/MetadataForm';
|
|
5
|
+
import Split from '../../../../comps/Split';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import JsonView from '@/comps/JsonView';
|
|
8
|
+
var Preview = function Preview(props) {
|
|
9
|
+
var schema = props.schema;
|
|
10
|
+
var _React$useState = React.useState(''),
|
|
11
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
12
|
+
json = _React$useState2[0],
|
|
13
|
+
setJson = _React$useState2[1];
|
|
14
|
+
var formRef = React.useRef();
|
|
15
|
+
var onFinish = function onFinish(vals) {
|
|
16
|
+
setJson(JSON.stringify(vals));
|
|
17
|
+
};
|
|
18
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
style: {
|
|
20
|
+
width: '100%',
|
|
21
|
+
height: 'calc(100% - 40px)',
|
|
22
|
+
background: 'var(--ronds-metadata-color-bg-2)',
|
|
23
|
+
padding: '8px',
|
|
24
|
+
border: '1px solid var(--ronds-metadata-color-border-1)',
|
|
25
|
+
overflowY: 'auto'
|
|
26
|
+
}
|
|
27
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Button, {
|
|
28
|
+
type: "primary",
|
|
29
|
+
onClick: function onClick() {
|
|
30
|
+
formRef.current.submit();
|
|
31
|
+
}
|
|
32
|
+
}, "\u63D0\u4EA4"), /*#__PURE__*/React.createElement(_Button, null, "\u91CD\u7F6E")), /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
style: {
|
|
34
|
+
height: 'calc(100% - 40px)',
|
|
35
|
+
background: 'var(--ronds-metadata-color-bg-2)'
|
|
36
|
+
}
|
|
37
|
+
}, /*#__PURE__*/React.createElement(Split, {
|
|
38
|
+
sizes: [70, 30],
|
|
39
|
+
gutterSize: 1
|
|
40
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
41
|
+
style: {
|
|
42
|
+
padding: '8px'
|
|
43
|
+
}
|
|
44
|
+
}, /*#__PURE__*/React.createElement(MetadataForm, {
|
|
45
|
+
schema: schema,
|
|
46
|
+
getFormInstance: function getFormInstance(form) {
|
|
47
|
+
formRef.current = form;
|
|
48
|
+
},
|
|
49
|
+
onFinish: onFinish
|
|
50
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
style: {
|
|
52
|
+
padding: '8px'
|
|
53
|
+
}
|
|
54
|
+
}, /*#__PURE__*/React.createElement(JsonView, {
|
|
55
|
+
json: json
|
|
56
|
+
}))))));
|
|
57
|
+
};
|
|
58
|
+
export default Preview;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (props: any) => JSX.Element;
|
|
1
|
+
declare const _default: (props: any) => import("react").JSX.Element;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (props: any) => JSX.Element;
|
|
1
|
+
declare const _default: (props: any) => import("react").JSX.Element;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (props: any) => JSX.Element;
|
|
1
|
+
declare const _default: (props: any) => import("react").JSX.Element;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (props: any) => JSX.Element;
|
|
1
|
+
declare const _default: (props: any) => import("react").JSX.Element;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (props: any) => JSX.Element;
|
|
1
|
+
declare const _default: (props: any) => import("react").JSX.Element;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (props: any) => JSX.Element;
|
|
1
|
+
declare const _default: (props: any) => import("react").JSX.Element;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (props: any) => JSX.Element;
|
|
1
|
+
declare const _default: (props: any) => import("react").JSX.Element;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (props: any) => JSX.Element;
|
|
1
|
+
declare const _default: (props: any) => import("react").JSX.Element;
|
|
2
2
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (props: any) => JSX.Element;
|
|
1
|
+
declare const _default: (props: any) => import("react").JSX.Element;
|
|
2
2
|
export default _default;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function withFieldCellWrapper(WrappedComponent: any): (props: any) => React.JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FG } from '../../../../interface';
|
|
2
|
+
import React from 'react';
|
|
2
3
|
interface IRenderFieldProps {
|
|
3
4
|
data: FG.Node;
|
|
4
5
|
/**
|
|
@@ -7,5 +8,5 @@ interface IRenderFieldProps {
|
|
|
7
8
|
refId?: string;
|
|
8
9
|
isShowAction?: boolean;
|
|
9
10
|
}
|
|
10
|
-
declare const RenderField: (props: IRenderFieldProps) => JSX.Element;
|
|
11
|
+
declare const RenderField: (props: IRenderFieldProps) => React.JSX.Element;
|
|
11
12
|
export default RenderField;
|
|
@@ -17,5 +17,5 @@ interface ICanvasCoreProps {
|
|
|
17
17
|
*/
|
|
18
18
|
onChange?: (nodes: FG.Node[]) => void;
|
|
19
19
|
}
|
|
20
|
-
declare const _default: React.MemoExoticComponent<(props: ICanvasCoreProps) => JSX.Element>;
|
|
20
|
+
declare const _default: React.MemoExoticComponent<(props: ICanvasCoreProps) => React.JSX.Element>;
|
|
21
21
|
export default _default;
|
|
@@ -8,7 +8,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
8
8
|
/*
|
|
9
9
|
* @Author: wangxian
|
|
10
10
|
* @Date: 2023-02-06 08:24:17
|
|
11
|
-
* @LastEditTime: 2023-06-
|
|
11
|
+
* @LastEditTime: 2023-06-30 16:42:07
|
|
12
12
|
*/
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import copy from 'copy-to-clipboard';
|
|
@@ -16,8 +16,8 @@ import { FGCtx } from '../../Provider';
|
|
|
16
16
|
import { formSetting, streamEventType } from '../../settings';
|
|
17
17
|
import { transFG2Schema } from '../../transformer';
|
|
18
18
|
import CanvasCore from './core';
|
|
19
|
-
import MetadataForm from '../../../../comps/MetadataForm';
|
|
20
19
|
import useObservable from '../../../../framework/rxjs-hooks/useObservable';
|
|
20
|
+
import Preview from './Preview';
|
|
21
21
|
var Canvas = function Canvas() {
|
|
22
22
|
var nodesRef = React.useRef([]);
|
|
23
23
|
var settingRef = React.useRef({
|
|
@@ -34,11 +34,27 @@ var Canvas = function Canvas() {
|
|
|
34
34
|
case streamEventType.onSettingValueChange:
|
|
35
35
|
if (p === null || p === void 0 ? void 0 : p.payload) {
|
|
36
36
|
settingRef.current = p.payload.allSetting;
|
|
37
|
+
fGCtx.fgStream && fGCtx.fgStream.next({
|
|
38
|
+
type: streamEventType.onJsonSchema,
|
|
39
|
+
payload: {
|
|
40
|
+
nodes: nodesRef.current,
|
|
41
|
+
settings: settingRef.current,
|
|
42
|
+
types: typesRef.current
|
|
43
|
+
}
|
|
44
|
+
});
|
|
37
45
|
}
|
|
38
46
|
break;
|
|
39
47
|
case streamEventType.onTypesChange:
|
|
40
48
|
if (p === null || p === void 0 ? void 0 : p.payload) {
|
|
41
49
|
typesRef.current = _objectSpread(_objectSpread({}, typesRef.current), p === null || p === void 0 ? void 0 : p.payload);
|
|
50
|
+
fGCtx.fgStream && fGCtx.fgStream.next({
|
|
51
|
+
type: streamEventType.onJsonSchema,
|
|
52
|
+
payload: {
|
|
53
|
+
nodes: nodesRef.current,
|
|
54
|
+
settings: settingRef.current,
|
|
55
|
+
types: typesRef.current
|
|
56
|
+
}
|
|
57
|
+
});
|
|
42
58
|
}
|
|
43
59
|
break;
|
|
44
60
|
}
|
|
@@ -87,18 +103,9 @@ var Canvas = function Canvas() {
|
|
|
87
103
|
_message.success("\u5DF2\u590D\u5236\u5230\u526A\u5207\u677F");
|
|
88
104
|
}
|
|
89
105
|
}
|
|
90
|
-
}, "\u5BFC\u51FASchema")), schema.length > 0 && /*#__PURE__*/React.createElement(
|
|
91
|
-
style: {
|
|
92
|
-
width: '100%',
|
|
93
|
-
height: 'calc(100% - 40px)',
|
|
94
|
-
background: 'var(--ronds-metadata-color-bg-2)',
|
|
95
|
-
padding: '8px',
|
|
96
|
-
border: '1px solid var(--ronds-metadata-color-border-1)',
|
|
97
|
-
overflowY: 'auto'
|
|
98
|
-
}
|
|
99
|
-
}, /*#__PURE__*/React.createElement(MetadataForm, {
|
|
106
|
+
}, "\u5BFC\u51FASchema")), schema.length > 0 && /*#__PURE__*/React.createElement(Preview, {
|
|
100
107
|
schema: schema
|
|
101
|
-
})
|
|
108
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
102
109
|
style: {
|
|
103
110
|
width: '100%',
|
|
104
111
|
height: '100%',
|
|
@@ -107,6 +114,14 @@ var Canvas = function Canvas() {
|
|
|
107
114
|
}, /*#__PURE__*/React.createElement(CanvasCore, {
|
|
108
115
|
onChange: function onChange(nodes) {
|
|
109
116
|
nodesRef.current = nodes;
|
|
117
|
+
fGCtx.fgStream && fGCtx.fgStream.next({
|
|
118
|
+
type: streamEventType.onJsonSchema,
|
|
119
|
+
payload: {
|
|
120
|
+
nodes: nodesRef.current,
|
|
121
|
+
settings: settingRef.current,
|
|
122
|
+
types: typesRef.current
|
|
123
|
+
}
|
|
124
|
+
});
|
|
110
125
|
}
|
|
111
126
|
})));
|
|
112
127
|
};
|
|
@@ -1,24 +1,46 @@
|
|
|
1
1
|
import "antd/es/radio/style";
|
|
2
2
|
import _Radio from "antd/es/radio";
|
|
3
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
3
4
|
import "antd/es/row/style";
|
|
4
5
|
import _Row from "antd/es/row";
|
|
5
6
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
7
|
/*
|
|
7
8
|
* @Author: uloveits 719310130@qq.com
|
|
8
9
|
* @Date: 2023-02-04 16:35:16
|
|
9
|
-
* @LastEditors:
|
|
10
|
-
* @LastEditTime: 2023-06-30
|
|
10
|
+
* @LastEditors: uloveits 719310130@qq.com
|
|
11
|
+
* @LastEditTime: 2023-06-30 16:36:35
|
|
11
12
|
*/
|
|
12
13
|
import React from 'react';
|
|
13
|
-
import { sidebarCtx } from '../../settings';
|
|
14
|
+
import { sidebarCtx, streamEventType } from '../../settings';
|
|
14
15
|
import Elements from './Elements';
|
|
15
16
|
import './index.less';
|
|
16
17
|
import JsonSchema from './JsonSchema';
|
|
18
|
+
import useObservable from '../../../../framework/rxjs-hooks/useObservable';
|
|
19
|
+
import { FGCtx } from '../../Provider';
|
|
20
|
+
import { transFG2Schema } from '../../transformer';
|
|
17
21
|
var Sidebar = function Sidebar() {
|
|
18
22
|
var _React$useState = React.useState('comps'),
|
|
19
23
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
20
24
|
active = _React$useState2[0],
|
|
21
25
|
setActive = _React$useState2[1];
|
|
26
|
+
var fGCtx = React.useContext(FGCtx) || {};
|
|
27
|
+
var _React$useState3 = React.useState([]),
|
|
28
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
29
|
+
schema = _React$useState4[0],
|
|
30
|
+
setSchema = _React$useState4[1];
|
|
31
|
+
var schemaParamRef = React.useRef();
|
|
32
|
+
var processFgStreamData = React.useCallback(function (p) {
|
|
33
|
+
switch (p === null || p === void 0 ? void 0 : p.type) {
|
|
34
|
+
case streamEventType.onJsonSchema:
|
|
35
|
+
if (p === null || p === void 0 ? void 0 : p.payload) {
|
|
36
|
+
schemaParamRef.current = p.payload;
|
|
37
|
+
}
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}, []);
|
|
41
|
+
useObservable(function (p) {
|
|
42
|
+
processFgStreamData(p);
|
|
43
|
+
}, [fGCtx.fgStream]);
|
|
22
44
|
return /*#__PURE__*/React.createElement("div", {
|
|
23
45
|
className: "fg-sidebar"
|
|
24
46
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -57,7 +79,7 @@ var Sidebar = function Sidebar() {
|
|
|
57
79
|
display: "".concat(active === 'json' ? '' : 'none')
|
|
58
80
|
}
|
|
59
81
|
}, /*#__PURE__*/React.createElement(JsonSchema, {
|
|
60
|
-
json:
|
|
82
|
+
json: JSON.stringify(schema)
|
|
61
83
|
})), /*#__PURE__*/React.createElement("div", {
|
|
62
84
|
className: "fg-sidebar-bottom-tool"
|
|
63
85
|
}, /*#__PURE__*/React.createElement(_Radio.Group, {
|
|
@@ -70,6 +92,10 @@ var Sidebar = function Sidebar() {
|
|
|
70
92
|
}],
|
|
71
93
|
onChange: function onChange(_ref) {
|
|
72
94
|
var value = _ref.target.value;
|
|
95
|
+
if (value === 'json' && schemaParamRef.current) {
|
|
96
|
+
var _schema = transFG2Schema(schemaParamRef.current.nodes, schemaParamRef.current.settings, schemaParamRef.current.types);
|
|
97
|
+
setSchema(_toConsumableArray(_schema || []));
|
|
98
|
+
}
|
|
73
99
|
setActive(value);
|
|
74
100
|
},
|
|
75
101
|
value: active,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import './index.less';
|
|
2
3
|
interface IFormGeneratorProps {
|
|
3
4
|
/**
|
|
@@ -5,5 +6,5 @@ interface IFormGeneratorProps {
|
|
|
5
6
|
*/
|
|
6
7
|
defaultSchema?: any;
|
|
7
8
|
}
|
|
8
|
-
declare const FormGenerator: (props: IFormGeneratorProps) => JSX.Element;
|
|
9
|
+
declare const FormGenerator: (props: IFormGeneratorProps) => React.JSX.Element;
|
|
9
10
|
export default FormGenerator;
|
|
@@ -68,8 +68,12 @@ export declare namespace StreamEvent {
|
|
|
68
68
|
type: 'onDefaultValue';
|
|
69
69
|
payload?: FG.IDefaultValue;
|
|
70
70
|
}
|
|
71
|
+
interface onJsonSchema {
|
|
72
|
+
type: 'onJsonSchema';
|
|
73
|
+
payload?: FG.IDefaultValue;
|
|
74
|
+
}
|
|
71
75
|
}
|
|
72
|
-
export type IFGStream = StreamEvent.onNodeSelect | StreamEvent.onClearCanvas | StreamEvent.onNodeDelete | StreamEvent.onNodeCopy | StreamEvent.onSettingValueChange | StreamEvent.onDropOver | StreamEvent.onTypesChange | StreamEvent.onDefaultValue;
|
|
76
|
+
export type IFGStream = StreamEvent.onNodeSelect | StreamEvent.onClearCanvas | StreamEvent.onNodeDelete | StreamEvent.onNodeCopy | StreamEvent.onSettingValueChange | StreamEvent.onDropOver | StreamEvent.onTypesChange | StreamEvent.onDefaultValue | StreamEvent.onJsonSchema;
|
|
73
77
|
export interface IFGCtxProps {
|
|
74
78
|
fgStream?: BehaviorSubject<IFGStream | undefined>;
|
|
75
79
|
types?: {
|
|
@@ -2,7 +2,7 @@ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
|
2
2
|
/*
|
|
3
3
|
* @Author: wangxian
|
|
4
4
|
* @Date: 2023-02-06 08:24:17
|
|
5
|
-
* @LastEditTime: 2023-06-
|
|
5
|
+
* @LastEditTime: 2023-06-30 16:21:01
|
|
6
6
|
*/
|
|
7
7
|
import { RefRule, Rule } from './ruleConfig';
|
|
8
8
|
export var inputSchema = [{
|
|
@@ -394,5 +394,6 @@ export var streamEventType = {
|
|
|
394
394
|
onSettingValueChange: 'onSettingValueChange',
|
|
395
395
|
onTypesChange: 'onTypesChange',
|
|
396
396
|
onDropOver: 'onDropOver',
|
|
397
|
-
onDefaultValue: 'onDefaultValue'
|
|
397
|
+
onDefaultValue: 'onDefaultValue',
|
|
398
|
+
onJsonSchema: 'onJsonSchema'
|
|
398
399
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import 'codemirror/lib/codemirror.css';
|
|
2
3
|
import 'codemirror/theme/neo.css';
|
|
3
4
|
import 'codemirror/theme/panda-syntax.css';
|
|
@@ -65,5 +66,5 @@ interface ISqlEditProps {
|
|
|
65
66
|
*/
|
|
66
67
|
onReWriteEnter?: () => void;
|
|
67
68
|
}
|
|
68
|
-
declare const SqlEdit: (props: ISqlEditProps) => JSX.Element;
|
|
69
|
+
declare const SqlEdit: (props: ISqlEditProps) => React.JSX.Element;
|
|
69
70
|
export default SqlEdit;
|