ronds-metadata 1.1.8 → 1.1.9

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.
@@ -3,10 +3,11 @@ import React from "react";
3
3
  /*
4
4
  * @Author: wangxian
5
5
  * @Date: 2022-05-26 08:50:06
6
- * @LastEditTime: 2022-05-26 09:11:54
6
+ * @LastEditTime: 2022-05-28 11:10:24
7
7
  */
8
8
  import { DragSource } from 'react-dnd';
9
9
  import { GlobalOutlined } from '@ant-design/icons';
10
+ import Icon from '../../../comps/Icons';
10
11
  import { DRAGGABLE_COMPONENT } from '../constant';
11
12
  import "../index.css";
12
13
 
@@ -18,7 +19,9 @@ var InnerNodeTitle = function InnerNodeTitle(props) {
18
19
  className: "node-element"
19
20
  }, /*#__PURE__*/React.createElement("div", {
20
21
  className: "icon"
21
- }, /*#__PURE__*/React.createElement(GlobalOutlined, null)), /*#__PURE__*/React.createElement("div", {
22
+ }, (data === null || data === void 0 ? void 0 : data.icon) ? /*#__PURE__*/React.createElement(Icon, {
23
+ type: data === null || data === void 0 ? void 0 : data.icon
24
+ }) : /*#__PURE__*/React.createElement(GlobalOutlined, null)), /*#__PURE__*/React.createElement("div", {
22
25
  className: "notation"
23
26
  }, /*#__PURE__*/React.createElement("div", {
24
27
  className: "name"
@@ -4,12 +4,13 @@ import _Popover from "antd/es/popover";
4
4
  /*
5
5
  * @Author: wangxian
6
6
  * @Date: 2022-05-27 14:21:23
7
- * @LastEditTime: 2022-05-28 10:10:06
7
+ * @LastEditTime: 2022-05-28 10:18:24
8
8
  */
9
9
  import React from 'react';
10
10
  import { CompressOutlined, OneToOneOutlined, ZoomInOutlined, ZoomOutOutlined } from '@ant-design/icons';
11
11
  import classNames from 'classnames';
12
12
  import "./index.css";
13
+ import { tr } from '@/framework/locale';
13
14
  export var GraphHandler = function GraphHandler(props) {
14
15
  var className = props.className,
15
16
  onZoomIn = props.onZoomIn,
@@ -20,28 +21,28 @@ export var GraphHandler = function GraphHandler(props) {
20
21
  className: classNames('handler', className)
21
22
  }, /*#__PURE__*/React.createElement(_Popover, {
22
23
  overlayClassName: "popover",
23
- content: "\u653E\u5927",
24
+ content: tr('放大'),
24
25
  placement: "left"
25
26
  }, /*#__PURE__*/React.createElement("li", {
26
27
  onClick: onZoomIn,
27
28
  className: "item"
28
29
  }, /*#__PURE__*/React.createElement(ZoomInOutlined, null))), /*#__PURE__*/React.createElement(_Popover, {
29
30
  overlayClassName: "popover",
30
- content: "\u7F29\u5C0F",
31
+ content: tr('缩小'),
31
32
  placement: "left"
32
33
  }, /*#__PURE__*/React.createElement("li", {
33
34
  onClick: onZoomOut,
34
35
  className: "item"
35
36
  }, /*#__PURE__*/React.createElement(ZoomOutOutlined, null))), /*#__PURE__*/React.createElement(_Popover, {
36
37
  overlayClassName: "popover",
37
- content: "\u5B9E\u9645\u5C3A\u5BF8",
38
+ content: tr('实际尺寸'),
38
39
  placement: "left"
39
40
  }, /*#__PURE__*/React.createElement("li", {
40
41
  onClick: onRealContent,
41
42
  className: "item"
42
43
  }, /*#__PURE__*/React.createElement(OneToOneOutlined, null))), /*#__PURE__*/React.createElement(_Popover, {
43
44
  overlayClassName: "popover",
44
- content: "\u9002\u5E94\u753B\u5E03",
45
+ content: tr('适应画布'),
45
46
  placement: "left"
46
47
  }, /*#__PURE__*/React.createElement("li", {
47
48
  onClick: onFitContent,
@@ -3,20 +3,24 @@ import React from "react";
3
3
  /*
4
4
  * @Author: wangxian
5
5
  * @Date: 2022-05-24 08:50:16
6
- * @LastEditTime: 2022-05-26 16:37:24
6
+ * @LastEditTime: 2022-05-28 11:09:22
7
7
  */
8
8
  import { GlobalOutlined } from '@ant-design/icons';
9
9
  import "../index.css";
10
+ import Icon from '../../../comps/Icons';
10
11
 
11
12
  var NodeElement = function NodeElement(props) {
12
13
  var node = props.node;
13
14
  var data = (node === null || node === void 0 ? void 0 : node.getData()) || {};
14
- var name = data.name;
15
+ var name = data.name,
16
+ icon = data.icon;
15
17
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
16
18
  className: "node-element"
17
19
  }, /*#__PURE__*/React.createElement("div", {
18
- className: 'icon'
19
- }, /*#__PURE__*/React.createElement(GlobalOutlined, null)), /*#__PURE__*/React.createElement("div", {
20
+ className: "icon"
21
+ }, icon ? /*#__PURE__*/React.createElement(Icon, {
22
+ type: icon
23
+ }) : /*#__PURE__*/React.createElement(GlobalOutlined, null)), /*#__PURE__*/React.createElement("div", {
20
24
  className: "notation"
21
25
  }, /*#__PURE__*/React.createElement("div", {
22
26
  className: "name"
@@ -4,8 +4,18 @@ export declare namespace NDPGraph {
4
4
  edges: Edge[];
5
5
  }
6
6
  interface Node {
7
+ /**
8
+ * 图渲染的主键id
9
+ */
7
10
  id: string;
11
+ /**
12
+ * 原始组件库的id
13
+ */
8
14
  libId?: string;
15
+ /**
16
+ * 图标
17
+ */
18
+ icon?: string;
9
19
  name: string;
10
20
  inPorts: InPort[];
11
21
  outPorts: OutPort[];
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * @Author: wangxian
3
3
  * @Date: 2022-05-24 16:10:46
4
- * @LastEditTime: 2022-05-26 10:47:42
4
+ * @LastEditTime: 2022-05-28 10:57:33
5
5
  */
6
6
  export {};
@@ -22,6 +22,7 @@ export declare function formatNodeInfoToNodeMeta(nodeData: NDPGraph.Node, inputP
22
22
  y: number;
23
23
  id: string;
24
24
  libId?: string;
25
+ icon?: string;
25
26
  name: string;
26
27
  inPorts: NDPGraph.InPort[];
27
28
  outPorts: NDPGraph.OutPort[];
@@ -32,6 +33,7 @@ export declare function formatNodeInfoToNodeMeta(nodeData: NDPGraph.Node, inputP
32
33
  };
33
34
  zIndex: number;
34
35
  libId?: string;
36
+ icon?: string;
35
37
  name: string;
36
38
  inPorts: NDPGraph.InPort[];
37
39
  outPorts: NDPGraph.OutPort[];
@@ -55,6 +57,7 @@ export declare function formatGraphData(graphData: NDPGraph.GraphData): {
55
57
  y: number;
56
58
  id: string;
57
59
  libId?: string;
60
+ icon?: string;
58
61
  name: string;
59
62
  inPorts: NDPGraph.InPort[];
60
63
  outPorts: NDPGraph.OutPort[];
@@ -65,6 +68,7 @@ export declare function formatGraphData(graphData: NDPGraph.GraphData): {
65
68
  };
66
69
  zIndex: number;
67
70
  libId?: string;
71
+ icon?: string;
68
72
  name: string;
69
73
  inPorts: NDPGraph.InPort[];
70
74
  outPorts: NDPGraph.OutPort[];
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import '../../framework/libs/iconfont/iconfont.css';
3
+ interface Props {
4
+ /**
5
+ * 图标类型
6
+ */
7
+ type: string;
8
+ /**
9
+ * class样式
10
+ */
11
+ className?: string;
12
+ /**
13
+ * style
14
+ */
15
+ style?: React.CSSProperties;
16
+ }
17
+ declare const Icon: React.FC<Props>;
18
+ export default Icon;
@@ -0,0 +1,23 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import React from "react";
3
+
4
+ /*
5
+ * @Author: wangxian
6
+ * @Date: 2022-05-28 11:04:20
7
+ * @LastEditTime: 2022-05-28 11:15:23
8
+ */
9
+ import '../../framework/libs/iconfont/iconfont.css';
10
+
11
+ var Icon = function Icon(props) {
12
+ var type = props.type,
13
+ _props$className = props.className,
14
+ className = _props$className === void 0 ? '' : _props$className,
15
+ _props$style = props.style,
16
+ style = _props$style === void 0 ? {} : _props$style;
17
+ return /*#__PURE__*/React.createElement("span", {
18
+ className: "fa fa-".concat(type, " ").concat(className),
19
+ style: _objectSpread({}, style)
20
+ });
21
+ };
22
+
23
+ export default Icon;
@@ -12,5 +12,9 @@ declare const _default: {
12
12
  请输入title: string;
13
13
  确认会删除该列: string;
14
14
  当前值无修改: string;
15
+ 放大: string;
16
+ 缩小: string;
17
+ 实际尺寸: string;
18
+ 适应画布: string;
15
19
  };
16
20
  export default _default;
@@ -1,3 +1,8 @@
1
+ /*
2
+ * @Author: wangxian
3
+ * @Date: 2022-05-09 11:53:44
4
+ * @LastEditTime: 2022-05-28 10:21:09
5
+ */
1
6
  export default {
2
7
  操作: 'Operation',
3
8
  添加一行: 'Add New Line',
@@ -11,5 +16,9 @@ export default {
11
16
  请输入key: 'Please enter key',
12
17
  请输入title: 'Please enter title',
13
18
  确认会删除该列: 'Confirm will delete the column?',
14
- 当前值无修改: 'No change to current value'
19
+ 当前值无修改: 'No change to current value',
20
+ 放大: 'Enlarge',
21
+ 缩小: 'zoom out',
22
+ 实际尺寸: 'Actual size',
23
+ 适应画布: 'Fit to canvas'
15
24
  };
@@ -12,5 +12,9 @@ declare const _default: {
12
12
  请输入title: string;
13
13
  确认会删除该列: string;
14
14
  当前值无修改: string;
15
+ 放大: string;
16
+ 缩小: string;
17
+ 实际尺寸: string;
18
+ 适应画布: string;
15
19
  };
16
20
  export default _default;
@@ -1,3 +1,8 @@
1
+ /*
2
+ * @Author: wangxian
3
+ * @Date: 2022-05-09 11:53:44
4
+ * @LastEditTime: 2022-05-28 10:19:25
5
+ */
1
6
  export default {
2
7
  操作: '操作',
3
8
  添加一行: '添加一行',
@@ -11,5 +16,9 @@ export default {
11
16
  请输入key: '请输入key',
12
17
  请输入title: '请输入title',
13
18
  确认会删除该列: '确认会删除该列?',
14
- 当前值无修改: '当前值无修改'
19
+ 当前值无修改: '当前值无修改',
20
+ 放大: '放大',
21
+ 缩小: '缩小',
22
+ 实际尺寸: '实际尺寸',
23
+ 适应画布: '适应画布'
15
24
  };
@@ -0,0 +1,187 @@
1
+ @font-face {
2
+ font-family: "fa"; /* Project id 2247093 */
3
+ src: url('iconfont.woff2?t=1653706081036') format('woff2'),
4
+ url('iconfont.woff?t=1653706081036') format('woff'),
5
+ url('iconfont.ttf?t=1653706081036') format('truetype');
6
+ }
7
+
8
+ .fa {
9
+ font-family: "fa" !important;
10
+ font-size: 16px;
11
+ font-style: normal;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ }
15
+
16
+ .fa-py:before {
17
+ content: "\e916";
18
+ }
19
+
20
+ .fa-Redis:before {
21
+ content: "\e669";
22
+ }
23
+
24
+ .fa-hezi:before {
25
+ content: "\e60b";
26
+ }
27
+
28
+ .fa-message:before {
29
+ content: "\e637";
30
+ }
31
+
32
+ .fa-shujuku:before {
33
+ content: "\e645";
34
+ }
35
+
36
+ .fa-hourglass:before {
37
+ content: "\e66b";
38
+ }
39
+
40
+ .fa-Bucket:before {
41
+ content: "\e8ce";
42
+ }
43
+
44
+ .fa-RondsLake:before {
45
+ content: "\e8a2";
46
+ }
47
+
48
+ .fa-Schema:before {
49
+ content: "\e62a";
50
+ }
51
+
52
+ .fa-Minio:before {
53
+ content: "\e64e";
54
+ }
55
+
56
+ .fa-color:before {
57
+ content: "\e678";
58
+ }
59
+
60
+ .fa-Neo4j:before {
61
+ content: "\e612";
62
+ }
63
+
64
+ .fa-knowledge:before {
65
+ content: "\e621";
66
+ }
67
+
68
+ .fa-evaluate:before {
69
+ content: "\e608";
70
+ }
71
+
72
+ .fa-json1:before {
73
+ content: "\e7bd";
74
+ }
75
+
76
+ .fa-result:before {
77
+ content: "\e64c";
78
+ }
79
+
80
+ .fa-analysis:before {
81
+ content: "\e72e";
82
+ }
83
+
84
+ .fa-select:before {
85
+ content: "\e701";
86
+ }
87
+
88
+ .fa-Http:before {
89
+ content: "\e668";
90
+ }
91
+
92
+ .fa-question:before {
93
+ content: "\e60e";
94
+ }
95
+
96
+ .fa-monitor:before {
97
+ content: "\e61f";
98
+ }
99
+
100
+ .fa-algorithm_lab:before {
101
+ content: "\e607";
102
+ }
103
+
104
+ .fa-engine:before {
105
+ content: "\e610";
106
+ }
107
+
108
+ .fa-user:before {
109
+ content: "\e713";
110
+ }
111
+
112
+ .fa-logout:before {
113
+ content: "\e611";
114
+ }
115
+
116
+ .fa-screen:before {
117
+ content: "\e606";
118
+ }
119
+
120
+ .fa-password:before {
121
+ content: "\e605";
122
+ }
123
+
124
+ .fa-news:before {
125
+ content: "\e638";
126
+ }
127
+
128
+ .fa-record:before {
129
+ content: "\e648";
130
+ }
131
+
132
+ .fa-home:before {
133
+ content: "\e609";
134
+ }
135
+
136
+ .fa-json:before {
137
+ content: "\e61a";
138
+ }
139
+
140
+ .fa-code:before {
141
+ content: "\e654";
142
+ }
143
+
144
+ .fa-diagram:before {
145
+ content: "\e60a";
146
+ }
147
+
148
+ .fa-setting:before {
149
+ content: "\e84b";
150
+ }
151
+
152
+ .fa-datasource:before {
153
+ content: "\e62e";
154
+ }
155
+
156
+ .fa-stream:before {
157
+ content: "\ec56";
158
+ }
159
+
160
+ .fa-Kafka:before {
161
+ content: "\e64f";
162
+ }
163
+
164
+ .fa-Table:before {
165
+ content: "\e72d";
166
+ }
167
+
168
+ .fa-PostgreSql:before {
169
+ content: "\e63b";
170
+ }
171
+
172
+ .fa-link:before {
173
+ content: "\e636";
174
+ }
175
+
176
+ .fa-LocalFileSystem:before {
177
+ content: "\e600";
178
+ }
179
+
180
+ .fa-Cassandra:before {
181
+ content: "\e74f";
182
+ }
183
+
184
+ .fa-DataBase:before {
185
+ content: "\e797";
186
+ }
187
+
package/es/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export { default as MdEditor } from './comps/MdEdit';
9
9
  export { default as Editable } from './comps/Editable';
10
10
  export { default as DynamicPorts } from './comps/DynamicPorts';
11
11
  export { default as DragNode } from './comps/DynamicPorts/comps/DragNode';
12
+ export { default as Icon } from './comps/Icons';
12
13
  export * from './framework/metadata/index';
13
14
  export { default as http, addInterceptor } from './framework/http/index';
14
15
  export { default as useMemoSubject } from './framework/rxjs-hooks/useMemoSubject';
package/es/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author:wangxian
3
3
  * @Date: 2021-09-18 14:15:04
4
- * @LastEditTime: 2022-05-26 09:02:38
4
+ * @LastEditTime: 2022-05-28 11:18:17
5
5
  */
6
6
  import "./theme.css";
7
7
  export { default as MetadataEdit } from './comps/MetadataEdit';
@@ -14,6 +14,7 @@ export { default as MdEditor } from './comps/MdEdit';
14
14
  export { default as Editable } from './comps/Editable';
15
15
  export { default as DynamicPorts } from './comps/DynamicPorts';
16
16
  export { default as DragNode } from './comps/DynamicPorts/comps/DragNode';
17
+ export { default as Icon } from './comps/Icons';
17
18
  export * from './framework/metadata/index';
18
19
  export { default as http, addInterceptor } from './framework/http/index';
19
20
  export { default as useMemoSubject } from './framework/rxjs-hooks/useMemoSubject';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "ronds-metadata",
4
- "version": "1.1.8",
4
+ "version": "1.1.9",
5
5
  "scripts": {
6
6
  "start": "dumi dev",
7
7
  "docs:build": "dumi build",
@@ -80,6 +80,7 @@
80
80
  "prettier": "^2.2.1",
81
81
  "style-loader": "^1.2.1",
82
82
  "webpack-cli": "^3.3.12",
83
+ "copy-to-clipboard": "^3.3.1",
83
84
  "yorkie": "^2.0.0"
84
85
  }
85
86
  }