ronds-metadata 1.1.12 → 1.1.15

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.
Files changed (67) hide show
  1. package/es/comps/DynamicPorts/comps/ContextMenu.js +1 -1
  2. package/es/comps/DynamicPorts/comps/{ContextMenu.css → ContextMenu.less} +0 -0
  3. package/es/comps/DynamicPorts/comps/DragNode.js +1 -1
  4. package/es/comps/DynamicPorts/comps/GraphHandler/index.js +1 -1
  5. package/es/comps/DynamicPorts/comps/GraphHandler/{index.css → index.less} +17 -10
  6. package/es/comps/DynamicPorts/comps/NodeElement.js +1 -1
  7. package/es/comps/DynamicPorts/comps/contextMenu/EdgeContextMenu/index.js +1 -1
  8. package/es/comps/DynamicPorts/comps/contextMenu/EdgeContextMenu/{index.css → index.less} +0 -0
  9. package/es/comps/DynamicPorts/comps/contextMenu/GraphContextMenu/index.js +1 -1
  10. package/es/comps/DynamicPorts/comps/contextMenu/GraphContextMenu/index.less +40 -0
  11. package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.js +1 -1
  12. package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.less +42 -0
  13. package/es/comps/DynamicPorts/comps/shape/edge.js +1 -1
  14. package/es/comps/DynamicPorts/comps/shape/edge.less +8 -0
  15. package/es/comps/DynamicPorts/graph.d.ts +1 -0
  16. package/es/comps/DynamicPorts/graph.js +71 -0
  17. package/es/comps/DynamicPorts/index.js +1 -1
  18. package/es/comps/DynamicPorts/index.less +198 -0
  19. package/es/comps/Editable/comps/EditableAction.js +8 -4
  20. package/es/comps/Editable/comps/EditableCell.js +1 -1
  21. package/es/comps/Editable/comps/EditableHeardCell.js +1 -1
  22. package/es/comps/Editable/comps/EditableRow.js +12 -2
  23. package/es/comps/Editable/comps/Texty.js +1 -1
  24. package/es/comps/Editable/comps/{Texty.css → Texty.less} +4 -0
  25. package/es/comps/Editable/comps/{index.css → index.less} +5 -0
  26. package/es/comps/Editable/index.d.ts +4 -0
  27. package/es/comps/Editable/index.js +6 -1
  28. package/es/comps/Editable/index.less +97 -0
  29. package/es/comps/JsonEdit/index.js +1 -1
  30. package/es/comps/JsonEdit/{index.css → index.less} +6 -0
  31. package/es/comps/JsonView/index.js +1 -1
  32. package/es/comps/JsonView/{index.css → index.less} +41 -41
  33. package/es/comps/MdEdit/index.js +1 -1
  34. package/es/comps/MdEdit/{index.css → index.less} +0 -0
  35. package/es/comps/MetadataEdit/index.js +1 -1
  36. package/es/comps/MetadataEdit/index.less +10 -0
  37. package/es/comps/MetadataEdit/type.d.ts +20 -20
  38. package/es/comps/MetadataEditV2/index.js +1 -1
  39. package/es/comps/MetadataEditV2/index.less +11 -0
  40. package/es/comps/MetadataForm/HOC/index.js +1 -1
  41. package/es/comps/MetadataForm/HOC/index.less +25 -0
  42. package/es/comps/MetadataForm/index.d.ts +1 -1
  43. package/es/comps/MetadataForm/index.js +1 -1
  44. package/es/comps/MetadataForm/index.less +11 -0
  45. package/es/comps/MetadataForm/interface.d.ts +1 -1
  46. package/es/comps/MetadataForm/interface.js +1 -1
  47. package/es/comps/MetadataForm/utils.js +15 -2
  48. package/es/framework/graph/index.d.ts +7 -0
  49. package/es/framework/graph/index.js +101 -11
  50. package/es/framework/graph/{index.css → index.less} +2 -0
  51. package/es/framework/libs/iconfont/iconfont.css +19 -3
  52. package/es/framework/libs/iconfont/iconfont.ttf +0 -0
  53. package/es/framework/libs/iconfont/iconfont.woff +0 -0
  54. package/es/framework/libs/iconfont/iconfont.woff2 +0 -0
  55. package/es/index.js +1 -1
  56. package/es/theme.less +69 -0
  57. package/package.json +87 -86
  58. package/es/comps/DynamicPorts/comps/contextMenu/GraphContextMenu/index.css +0 -21
  59. package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.css +0 -23
  60. package/es/comps/DynamicPorts/comps/shape/edge.css +0 -4
  61. package/es/comps/DynamicPorts/index.css +0 -169
  62. package/es/comps/Editable/index.css +0 -75
  63. package/es/comps/MetadataEdit/index.css +0 -10
  64. package/es/comps/MetadataEditV2/index.css +0 -11
  65. package/es/comps/MetadataForm/HOC/index.css +0 -25
  66. package/es/comps/MetadataForm/index.css +0 -9
  67. package/es/theme.css +0 -56
@@ -19,7 +19,7 @@ import EditableHeardCell from './comps/EditableHeardCell';
19
19
  import useMemoSubject from '../../framework/rxjs-hooks/useMemoSubject';
20
20
  import useObservable from '../../framework/rxjs-hooks/useObservable';
21
21
  import { tr } from '../../framework/locale';
22
- import "./index.css";
22
+ import './index.less';
23
23
 
24
24
  var Editable = function Editable(props) {
25
25
  var _props$type = props.type,
@@ -33,6 +33,7 @@ var Editable = function Editable(props) {
33
33
  _props$isAddColumn = props.isAddColumn,
34
34
  isAddColumn = _props$isAddColumn === void 0 ? false : _props$isAddColumn,
35
35
  tableProps = props.tableProps,
36
+ onRowClick = props.onRowClick,
36
37
  onRowConfirm = props.onRowConfirm,
37
38
  onRowDelete = props.onRowDelete,
38
39
  onMulChange = props.onMulChange,
@@ -120,6 +121,10 @@ var Editable = function Editable(props) {
120
121
  setEditHeardCellkey(data.payload);
121
122
  break;
122
123
 
124
+ case 'onRowClick':
125
+ onRowClick && onRowClick(data.payload);
126
+ break;
127
+
123
128
  case 'onSingleSave':
124
129
  if (lastValueRef.current && lastValueRef.current.rowIdx === data.payload._rowKey_) {
125
130
  onRowConfirm && onRowConfirm({
@@ -0,0 +1,97 @@
1
+ .ronds-edit-table {
2
+ // table {
3
+ // border-collapse: collapse !important;
4
+ // }
5
+ width: 100%;
6
+ height: 100%;
7
+
8
+ .ant-table-body {
9
+ overflow: auto !important;
10
+ }
11
+
12
+ //解决固定列底部预留的空隙
13
+ .ant-table-fixed-left,
14
+ .ant-table-fixed-right {
15
+ .ant-table-body-outer {
16
+ margin-bottom: 0 !important;
17
+ }
18
+ .ant-table-cell-scrollbar {
19
+ margin: 0 !important;
20
+ padding: 0 !important;
21
+ }
22
+ }
23
+
24
+ .ant-spin-nested-loading,
25
+ .ant-spin-container,
26
+ .ant-table,
27
+ .ant-table-container,
28
+ .ant-table-content {
29
+ width: 100%;
30
+ height: 100%;
31
+ }
32
+
33
+ .ant-table-cell,
34
+ .ant-table-row {
35
+ height: 30px;
36
+ padding: 0px 8px !important;
37
+ }
38
+
39
+ .ant-table-body {
40
+ height: 100%;
41
+ overflow-y: auto !important;
42
+ }
43
+
44
+ .ant-table.ant-table-small .ant-table-thead > tr > th {
45
+ padding: 8px !important;
46
+ background-color: #ebebeb;
47
+ border-right: 1px solid #f2f2f2;
48
+ }
49
+
50
+ .ant-table-fixed {
51
+ table-layout: fixed;
52
+ }
53
+
54
+ .ant-table-tbody > tr > td {
55
+ word-wrap: break-word;
56
+ word-break: break-all;
57
+ }
58
+
59
+ .ant-table.ant-table-bordered > .ant-table-container {
60
+ border-bottom: 1px solid #f0f0f0;
61
+ }
62
+
63
+ .ant-table .ant-table-expanded-row-fixed {
64
+ padding: 0% !important;
65
+ margin: 0% !important;
66
+ }
67
+
68
+ .ant-table.ant-table-bordered > .ant-table-container > .ant-table-body > table > tbody > tr > td > .ant-table-expanded-row-fixed::after {
69
+ border-right: 0 !important;
70
+ }
71
+ }
72
+
73
+ .ronds-metadata-normal {
74
+ .ant-table {
75
+ border-right: 1px solid #f0f0f0 !important;
76
+
77
+ .ant-table-row--odd {
78
+ background-color: #ebebeb !important;
79
+ .ant-table-cell {
80
+ background-color: #ebebeb !important;
81
+ }
82
+ }
83
+
84
+ .ant-table-expanded-row-fixed::after {
85
+ border: 0 !important;
86
+ }
87
+
88
+ .ant-table-placeholder {
89
+ pointer-events: none;
90
+ background-color: #fff !important;
91
+ .ant-table-cell {
92
+ padding: 0 !important;
93
+ background-color: #fff !important;
94
+ }
95
+ }
96
+ }
97
+ }
@@ -22,7 +22,7 @@ import 'codemirror/addon/fold/comment-fold';
22
22
  import 'codemirror/addon/selection/active-line.js';
23
23
  import 'codemirror/addon/edit/closebrackets.js';
24
24
  import 'codemirror/addon/edit/matchbrackets.js';
25
- import "./index.css";
25
+ import './index.less';
26
26
  import { SQL_DICO } from './constant';
27
27
 
28
28
  var SqlEdit = function SqlEdit(props) {
@@ -7,6 +7,7 @@
7
7
  .sql {
8
8
  color: blue;
9
9
  }
10
+
10
11
  .sql:after {
11
12
  content: 'sql';
12
13
  padding-left: 20px;
@@ -14,6 +15,7 @@
14
15
  float: right;
15
16
  color: gray;
16
17
  }
18
+
17
19
  .table {
18
20
  color: blueviolet;
19
21
  }
@@ -24,6 +26,7 @@
24
26
  float: right;
25
27
  color: gray;
26
28
  }
29
+
27
30
  .column {
28
31
  color: brown;
29
32
  }
@@ -34,6 +37,7 @@
34
37
  float: right;
35
38
  color: gray;
36
39
  }
40
+
37
41
  .pf {
38
42
  color: cadetblue;
39
43
  }
@@ -44,8 +48,10 @@
44
48
  float: right;
45
49
  color: gray;
46
50
  }
51
+
47
52
  .CodeMirror {
48
53
  height: 100%;
54
+ // height: auto;
49
55
  min-height: 28px;
50
56
  font-size: 14px;
51
57
  direction: ltr;
@@ -1,6 +1,6 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
2
  import React from 'react';
3
- import "./index.css";
3
+ import './index.less';
4
4
 
5
5
  var JsonView = function JsonView(props) {
6
6
  var json = props.json;
@@ -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
+ }
@@ -8,7 +8,7 @@ import MdEditor from 'react-markdown-editor-lite';
8
8
  import MarkdownIt from 'markdown-it';
9
9
  import emoji from 'markdown-it-emoji';
10
10
  import 'react-markdown-editor-lite/lib/index.css';
11
- import "./index.css";
11
+ import './index.less';
12
12
  var mdParser = new MarkdownIt({
13
13
  html: true,
14
14
  linkify: true,
File without changes
@@ -13,7 +13,7 @@ import "antd/es/form/style";
13
13
  import _Form from "antd/es/form";
14
14
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
15
15
  import React from 'react';
16
- import "./index.css";
16
+ import './index.less';
17
17
  import MetaFieldsEdit from './components/MetaFieldsEdit';
18
18
  import MetaPropsEdit from './components/MetaPropsEdit';
19
19
  import { OUTERMOST_TYPES_OPTIONS } from './constant';
@@ -0,0 +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,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
+ };
@@ -13,7 +13,7 @@ import "antd/es/form/style";
13
13
  import _Form from "antd/es/form";
14
14
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
15
15
  import React from 'react';
16
- import "./index.css";
16
+ import './index.less';
17
17
  import MetaFieldsEdit from './components/MetaFieldsEdit';
18
18
  import MetaPropsEdit from './components/MetaPropsEdit';
19
19
  import { OUTERMOST_TYPES_OPTIONS } from './constant';
@@ -0,0 +1,11 @@
1
+ .metadata-edit {
2
+ height: 100%;
3
+ width: 100%;
4
+ .ant-row {
5
+ display: block;
6
+ }
7
+ .pr-10 {
8
+ padding-right: 10px;
9
+ width: 50%;
10
+ }
11
+ }
@@ -8,7 +8,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
8
8
  */
9
9
  import React from 'react';
10
10
  import { deepClone } from '../../../utils';
11
- import "./index.css";
11
+ import './index.less';
12
12
  export function withAddOnAfter(WrappedComponent) {
13
13
  return function (props) {
14
14
  var type = props.type,
@@ -0,0 +1,25 @@
1
+ .with-add-on-after {
2
+ --card-bg: #ffffff;
3
+ position: relative;
4
+ width: 100%;
5
+ & > .ant-form-item {
6
+ padding: 0 !important;
7
+ flex: 1;
8
+ }
9
+ &-extra {
10
+ position: absolute;
11
+ right: 20px;
12
+ top: 18px;
13
+ padding: 0 6px;
14
+ background-color: var(--card-bg);
15
+ z-index: 1000;
16
+ }
17
+ &-ref {
18
+ position: absolute;
19
+ right: 20px;
20
+ top: -10px;
21
+ padding: 0 6px;
22
+ background-color: var(--card-bg);
23
+ z-index: 1000;
24
+ }
25
+ }
@@ -29,7 +29,7 @@ interface IMetadataFormProps {
29
29
  /**
30
30
  * 不可编辑
31
31
  */
32
- disabled?: boolean;
32
+ disabled?: boolean | string[];
33
33
  /**
34
34
  * 引用类型是否显示成表单
35
35
  */
@@ -5,7 +5,7 @@ import _Form from "antd/es/form";
5
5
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
6
  import React from 'react';
7
7
  import { renderForm } from './utils';
8
- import "./index.css";
8
+ import './index.less';
9
9
  import { MetadataFormContext } from './interface';
10
10
  import { JsonMetadataProvider } from '../../framework/metadata';
11
11
  import { MetadataService } from '../../framework/metadata/MetadataService';
@@ -0,0 +1,11 @@
1
+ .metadata-form {
2
+ .ant-row {
3
+ display: block;
4
+ }
5
+ .ant-form-item {
6
+ margin: 0;
7
+ }
8
+ .ant-form-item-label > label .ant-form-item-tooltip {
9
+ margin-left: 5px;
10
+ }
11
+ }
@@ -16,7 +16,7 @@ export interface IMetadataRefContextProps {
16
16
  }
17
17
  export declare const MetadataRefContext: React.Context<IMetadataRefContextProps>;
18
18
  export interface IFormOptions {
19
- disabled: boolean;
19
+ disabled: boolean | string[];
20
20
  isRefForm: boolean;
21
21
  isShowTypeInfo: boolean;
22
22
  initEnumValue?: boolean;
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author:wangxian
3
3
  * @Date: 2021-09-18 14:15:04
4
- * @LastEditTime: 2022-05-23 11:56:54
4
+ * @LastEditTime: 2022-06-08 15:45:36
5
5
  */
6
6
  import React from 'react';
7
7
  export var MetadataFormContext = /*#__PURE__*/React.createContext(null);
@@ -5,7 +5,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
5
5
  /*
6
6
  * @Author: wangxian
7
7
  * @Date: 2021-09-18 14:15:04
8
- * @LastEditTime: 2022-05-28 09:35:48
8
+ * @LastEditTime: 2022-06-08 15:54:53
9
9
  */
10
10
  import React from 'react';
11
11
  import Input from './DataCell/Input';
@@ -26,10 +26,23 @@ var DataCellMap = {
26
26
  export function getDataCell(item, options) {
27
27
  if (item.type && DataCellMap[item.type]) {
28
28
  var Comm = DataCellMap[item.type];
29
+
30
+ var isDisabled = function isDisabled(b) {
31
+ if (typeof b === 'boolean') {
32
+ return b;
33
+ } else if (b.findIndex(function (it) {
34
+ return it === item.id;
35
+ }) > -1) {
36
+ return true;
37
+ }
38
+
39
+ return false;
40
+ };
41
+
29
42
  return /*#__PURE__*/React.createElement(Comm, _extends({
30
43
  key: item.id
31
44
  }, item, {
32
- disabled: options.disabled,
45
+ disabled: isDisabled(options.disabled),
33
46
  isRefForm: options.isRefForm,
34
47
  isShowTypeInfo: options.isShowTypeInfo,
35
48
  field: options.field,
@@ -49,11 +49,18 @@ export declare class GraphCore<N extends Node<Node.Properties> = Node<Node.Prope
49
49
  validateContextMenu(data: ContextMenuInfo): boolean;
50
50
  onContextMenu(data: ContextMenuInfo): any;
51
51
  zoom: (factor: number | 'fit' | 'real') => void;
52
+ onMoveNodeStart(args: any): void;
53
+ onMoveNodes(args: any[]): void;
52
54
  addNode: (nodeMeta: any) => N;
55
+ getNodes: () => N[];
53
56
  addEdge: (edgeMeta: any) => E;
54
57
  deleteNodes: (nodes: (Node | string)[] | Node | string) => void;
55
58
  deleteEdges: (edges: (Edge | string)[] | Edge | string) => void;
56
59
  getNodeById: (nodeId: string) => N | undefined;
60
+ updateNodeById: (nodeId: string, handler: (node?: N) => void) => void;
61
+ updateNodes: (handler: (nodes: N[]) => void) => void;
62
+ updateEdgeById: (edgeId: string, handler: (node?: E) => void) => void;
63
+ updateEdges: (handler: (edges: E[]) => void) => void;
57
64
  throwRenderError: () => void;
58
65
  dispose(): void;
59
66
  }