strategy-panel 1.0.0

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 (162) hide show
  1. package/.eslintrc.js +9 -0
  2. package/.fatherrc.ts +26 -0
  3. package/.prettierrc.js +1 -0
  4. package/.umirc.ts +29 -0
  5. package/LICENSE +22 -0
  6. package/README.md +33 -0
  7. package/es/assets/AND.svg +11 -0
  8. package/es/assets/OR.svg +11 -0
  9. package/es/assets/XOR.svg +11 -0
  10. package/es/assets/add.svg +13 -0
  11. package/es/assets/alarm.svg +11 -0
  12. package/es/assets/application.svg +11 -0
  13. package/es/assets/cancel.svg +13 -0
  14. package/es/assets/check.svg +12 -0
  15. package/es/assets/condition.svg +12 -0
  16. package/es/assets/control.svg +11 -0
  17. package/es/assets/decive.svg +11 -0
  18. package/es/assets/delete.svg +11 -0
  19. package/es/assets/device.svg +11 -0
  20. package/es/assets/edit.svg +11 -0
  21. package/es/assets/hand.svg +11 -0
  22. package/es/assets/link.svg +11 -0
  23. package/es/assets/logical.svg +12 -0
  24. package/es/assets/notice.svg +11 -0
  25. package/es/assets/order.svg +11 -0
  26. package/es/assets/relation.svg +11 -0
  27. package/es/assets/rhombus.svg +3 -0
  28. package/es/assets/save.svg +13 -0
  29. package/es/assets/time.svg +11 -0
  30. package/es/assets/variate.svg +12 -0
  31. package/es/common/constants/global.d.ts +1 -0
  32. package/es/common/constants/global.js +1 -0
  33. package/es/common/constants/graph.d.ts +10 -0
  34. package/es/common/constants/graph.js +17 -0
  35. package/es/common/graph-common/category-type.d.ts +16 -0
  36. package/es/common/graph-common/category-type.js +72 -0
  37. package/es/common/graph-common/connector/index.d.ts +1 -0
  38. package/es/common/graph-common/connector/index.js +14 -0
  39. package/es/common/graph-common/node-element/common-element.less +117 -0
  40. package/es/common/graph-common/node-element/condition-element.d.ts +8 -0
  41. package/es/common/graph-common/node-element/condition-element.js +35 -0
  42. package/es/common/graph-common/node-element/condition-element.less +82 -0
  43. package/es/common/graph-common/node-element/logical-element.d.ts +8 -0
  44. package/es/common/graph-common/node-element/logical-element.js +34 -0
  45. package/es/common/graph-common/node-element/logical-element.less +54 -0
  46. package/es/common/graph-common/node-element/node-element.d.ts +8 -0
  47. package/es/common/graph-common/node-element/node-element.js +27 -0
  48. package/es/common/graph-common/node-element/node-element.less +48 -0
  49. package/es/common/graph-common/node-element/node-group.d.ts +8 -0
  50. package/es/common/graph-common/node-element/node-group.js +395 -0
  51. package/es/common/graph-common/node-element/node-group.less +53 -0
  52. package/es/common/graph-common/node-popover/index.d.ts +7 -0
  53. package/es/common/graph-common/node-popover/index.js +11 -0
  54. package/es/common/graph-common/node-popover/index.less +5 -0
  55. package/es/common/graph-common/node-types.d.ts +28 -0
  56. package/es/common/graph-common/node-types.js +60 -0
  57. package/es/common/graph-common/shape/edge.d.ts +10 -0
  58. package/es/common/graph-common/shape/edge.js +115 -0
  59. package/es/common/graph-common/shape/edge.less +8 -0
  60. package/es/common/graph-common/shape/node.d.ts +6 -0
  61. package/es/common/graph-common/shape/node.js +6 -0
  62. package/es/common/graph-common/shape/nodes/BaseNode.d.ts +4 -0
  63. package/es/common/graph-common/shape/nodes/BaseNode.js +46 -0
  64. package/es/common/graph-common/shape/nodes/CommonNode.d.ts +5 -0
  65. package/es/common/graph-common/shape/nodes/CommonNode.js +118 -0
  66. package/es/common/graph-common/shape/nodes/ConditionJudgment.d.ts +5 -0
  67. package/es/common/graph-common/shape/nodes/ConditionJudgment.js +130 -0
  68. package/es/common/graph-common/shape/nodes/GroupNode.d.ts +4 -0
  69. package/es/common/graph-common/shape/nodes/GroupNode.js +99 -0
  70. package/es/common/graph-common/shape/nodes/LogicalNode.d.ts +5 -0
  71. package/es/common/graph-common/shape/nodes/LogicalNode.js +130 -0
  72. package/es/common/graph-utils/graph.d.ts +83 -0
  73. package/es/common/graph-utils/graph.js +98 -0
  74. package/es/component/cut.d.ts +10 -0
  75. package/es/component/cut.js +34 -0
  76. package/es/component/cut.less +6 -0
  77. package/es/component/item-name.d.ts +6 -0
  78. package/es/component/item-name.js +30 -0
  79. package/es/component/keyword.d.ts +9 -0
  80. package/es/component/keyword.js +26 -0
  81. package/es/component/keyword.less +11 -0
  82. package/es/component/rx-component/rx-input.d.ts +8 -0
  83. package/es/component/rx-component/rx-input.js +47 -0
  84. package/es/hooks/useObservableState.d.ts +3 -0
  85. package/es/hooks/useObservableState.js +44 -0
  86. package/es/index.d.ts +8 -0
  87. package/es/index.js +9 -0
  88. package/es/pages/component-tree-panel/category-tree/index.d.ts +16 -0
  89. package/es/pages/component-tree-panel/category-tree/index.js +100 -0
  90. package/es/pages/component-tree-panel/category-tree/index.less +35 -0
  91. package/es/pages/component-tree-panel/category-tree/node-title.d.ts +12 -0
  92. package/es/pages/component-tree-panel/category-tree/node-title.js +57 -0
  93. package/es/pages/component-tree-panel/category-tree/node-title.less +113 -0
  94. package/es/pages/component-tree-panel/index.d.ts +17 -0
  95. package/es/pages/component-tree-panel/index.js +19 -0
  96. package/es/pages/component-tree-panel/index.less +51 -0
  97. package/es/pages/config-panel/components/condition-configuration/configure-modal/data-origin.d.ts +49 -0
  98. package/es/pages/config-panel/components/condition-configuration/configure-modal/data-origin.js +212 -0
  99. package/es/pages/config-panel/components/condition-configuration/configure-modal/index.d.ts +11 -0
  100. package/es/pages/config-panel/components/condition-configuration/configure-modal/index.js +178 -0
  101. package/es/pages/config-panel/components/condition-configuration/configure-modal/style.less +13 -0
  102. package/es/pages/config-panel/components/condition-configuration/cross-line.d.ts +8 -0
  103. package/es/pages/config-panel/components/condition-configuration/cross-line.js +47 -0
  104. package/es/pages/config-panel/components/condition-configuration/index.d.ts +9 -0
  105. package/es/pages/config-panel/components/condition-configuration/index.js +180 -0
  106. package/es/pages/config-panel/components/condition-configuration/style.less +70 -0
  107. package/es/pages/config-panel/components/time-trigger/components/cycle-time.d.ts +8 -0
  108. package/es/pages/config-panel/components/time-trigger/components/cycle-time.js +87 -0
  109. package/es/pages/config-panel/components/time-trigger/components/time-horizon.d.ts +9 -0
  110. package/es/pages/config-panel/components/time-trigger/components/time-horizon.js +73 -0
  111. package/es/pages/config-panel/components/time-trigger/delay-time.d.ts +8 -0
  112. package/es/pages/config-panel/components/time-trigger/delay-time.js +18 -0
  113. package/es/pages/config-panel/components/time-trigger/index.d.ts +8 -0
  114. package/es/pages/config-panel/components/time-trigger/index.js +84 -0
  115. package/es/pages/config-panel/components/time-trigger/interval-time.d.ts +8 -0
  116. package/es/pages/config-panel/components/time-trigger/interval-time.js +50 -0
  117. package/es/pages/config-panel/components/time-trigger/persistent-time.d.ts +8 -0
  118. package/es/pages/config-panel/components/time-trigger/persistent-time.js +18 -0
  119. package/es/pages/config-panel/components/time-trigger/timing-time.d.ts +8 -0
  120. package/es/pages/config-panel/components/time-trigger/timing-time.js +52 -0
  121. package/es/pages/config-panel/config-common.d.ts +37 -0
  122. package/es/pages/config-panel/config-common.js +135 -0
  123. package/es/pages/config-panel/index.d.ts +12 -0
  124. package/es/pages/config-panel/index.js +50 -0
  125. package/es/pages/config-panel/node-form.d.ts +21 -0
  126. package/es/pages/config-panel/node-form.js +97 -0
  127. package/es/pages/config-panel/style.less +62 -0
  128. package/es/pages/dag-canvas/canvas-content.d.ts +9 -0
  129. package/es/pages/dag-canvas/canvas-content.js +92 -0
  130. package/es/pages/dag-canvas/canvas-content.less +5 -0
  131. package/es/pages/dag-canvas/index.d.ts +13 -0
  132. package/es/pages/dag-canvas/index.js +28 -0
  133. package/es/pages/dag-canvas/index.less +11 -0
  134. package/es/pages/dag-canvas/preview.d.ts +9 -0
  135. package/es/pages/dag-canvas/preview.js +34 -0
  136. package/es/pages/index.d.ts +37 -0
  137. package/es/pages/index.js +73 -0
  138. package/es/pages/index.less +50 -0
  139. package/es/pages/rx-models/experiment-graph.d.ts +82 -0
  140. package/es/pages/rx-models/experiment-graph.js +1186 -0
  141. package/es/pages/rx-models/graph-core.d.ts +96 -0
  142. package/es/pages/rx-models/graph-core.js +755 -0
  143. package/es/pages/rx-models/graph-core.less +14 -0
  144. package/es/pages/rx-models/graph-util.d.ts +186 -0
  145. package/es/pages/rx-models/graph-util.js +358 -0
  146. package/es/pages/rx-models/typing.d.ts +126 -0
  147. package/es/pages/strategy-header/index.d.ts +56 -0
  148. package/es/pages/strategy-header/index.js +141 -0
  149. package/es/pages/strategy-header/style.less +22 -0
  150. package/es/pages/strategy-header/theme-switch/index.d.ts +4 -0
  151. package/es/pages/strategy-header/theme-switch/index.js +19 -0
  152. package/es/pages/strategy-header/theme-switch/style.less +11 -0
  153. package/es/style/basic.less +12 -0
  154. package/es/style/default.less +2 -0
  155. package/es/style/position.less +25 -0
  156. package/es/style/theme-light.less +7 -0
  157. package/es/style/variable.less +3 -0
  158. package/es/typings.d.ts +6 -0
  159. package/es/utils/utils.d.ts +1 -0
  160. package/es/utils/utils.js +1 -0
  161. package/package.json +70 -0
  162. package/tsconfig.json +18 -0
@@ -0,0 +1,8 @@
1
+ .x6-edge {
2
+ &-selected,
3
+ &:hover {
4
+ path[stroke-width='1'] {
5
+ stroke-width: 3px;
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,6 @@
1
+ import BaseNode from './nodes/BaseNode';
2
+ import CommonNode from './nodes/CommonNode';
3
+ import GroupNode from './nodes/GroupNode';
4
+ import ConditionJudgment from './nodes/ConditionJudgment';
5
+ import LogicalNode from './nodes/LogicalNode';
6
+ export { BaseNode, CommonNode, GroupNode, LogicalNode, ConditionJudgment };
@@ -0,0 +1,6 @@
1
+ import BaseNode from "./nodes/BaseNode";
2
+ import CommonNode from "./nodes/CommonNode";
3
+ import GroupNode from "./nodes/GroupNode";
4
+ import ConditionJudgment from "./nodes/ConditionJudgment";
5
+ import LogicalNode from "./nodes/LogicalNode";
6
+ export { BaseNode, CommonNode, GroupNode, LogicalNode, ConditionJudgment };
@@ -0,0 +1,4 @@
1
+ import { ReactShape } from '@antv/x6-react-shape';
2
+ export default class BaseNode extends ReactShape {
3
+ isGroup(): boolean;
4
+ }
@@ -0,0 +1,46 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
+
5
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6
+
7
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
8
+
9
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
10
+
11
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
12
+
13
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
+
15
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
16
+
17
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
+
19
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
20
+
21
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
22
+
23
+ import { ReactShape } from '@antv/x6-react-shape';
24
+
25
+ var BaseNode = /*#__PURE__*/function (_ReactShape) {
26
+ _inherits(BaseNode, _ReactShape);
27
+
28
+ var _super = _createSuper(BaseNode);
29
+
30
+ function BaseNode() {
31
+ _classCallCheck(this, BaseNode);
32
+
33
+ return _super.apply(this, arguments);
34
+ }
35
+
36
+ _createClass(BaseNode, [{
37
+ key: "isGroup",
38
+ value: function isGroup() {
39
+ return false;
40
+ }
41
+ }]);
42
+
43
+ return BaseNode;
44
+ }(ReactShape);
45
+
46
+ export { BaseNode as default };
@@ -0,0 +1,5 @@
1
+ import BaseNode from './BaseNode';
2
+ export default class CommonNode extends BaseNode {
3
+ getInPorts(): import("@antv/x6/lib/model/port").PortManager.PortMetadata[];
4
+ getOutPorts(): import("@antv/x6/lib/model/port").PortManager.PortMetadata[];
5
+ }
@@ -0,0 +1,118 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
+
5
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6
+
7
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
8
+
9
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
10
+
11
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
12
+
13
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
+
15
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
16
+
17
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
+
19
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
20
+
21
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
22
+
23
+ import BaseNode from "./BaseNode";
24
+ import { NODE_HEIGHT, NODE_WIDTH } from "../../../constants/graph";
25
+ import { Dom, Node } from '@antv/x6';
26
+
27
+ var CommonNode = /*#__PURE__*/function (_BaseNode) {
28
+ _inherits(CommonNode, _BaseNode);
29
+
30
+ var _super = _createSuper(CommonNode);
31
+
32
+ function CommonNode() {
33
+ _classCallCheck(this, CommonNode);
34
+
35
+ return _super.apply(this, arguments);
36
+ }
37
+
38
+ _createClass(CommonNode, [{
39
+ key: "getInPorts",
40
+ value: function getInPorts() {
41
+ return this.getPortsByGroup('in');
42
+ }
43
+ }, {
44
+ key: "getOutPorts",
45
+ value: function getOutPorts() {
46
+ return this.getPortsByGroup('out');
47
+ }
48
+ }]);
49
+
50
+ return CommonNode;
51
+ }(BaseNode);
52
+
53
+ export { CommonNode as default };
54
+ CommonNode.config({
55
+ width: NODE_WIDTH,
56
+ height: NODE_HEIGHT,
57
+ shape: 'base-rect-node',
58
+ ports: {
59
+ groups: {
60
+ in: {
61
+ position: {
62
+ name: 'top'
63
+ },
64
+ zIndex: 2
65
+ },
66
+ out: {
67
+ position: {
68
+ name: 'bottom'
69
+ },
70
+ zIndex: 2
71
+ }
72
+ }
73
+ },
74
+ attrs: {
75
+ body: {
76
+ magnet: false,
77
+ fill: 'none',
78
+ stroke: 'none',
79
+ refWidth: '100%',
80
+ refHeight: '100%',
81
+ zIndex: 1
82
+ }
83
+ },
84
+ portMarkup: [{
85
+ tagName: 'foreignObject',
86
+ selector: 'fo',
87
+ attrs: {
88
+ width: 8,
89
+ height: 8,
90
+ x: -4,
91
+ y: -4,
92
+ zIndex: 10,
93
+ // magnet决定是否可交互
94
+ magnet: 'true'
95
+ },
96
+ children: [{
97
+ ns: Dom.ns.xhtml,
98
+ tagName: 'body',
99
+ selector: 'foBody',
100
+ attrs: {
101
+ xmlns: Dom.ns.xhtml
102
+ },
103
+ style: {
104
+ width: '100%',
105
+ height: '100%'
106
+ },
107
+ children: [{
108
+ tagName: 'span',
109
+ selector: 'content',
110
+ style: {
111
+ width: '100%',
112
+ height: '100%'
113
+ }
114
+ }]
115
+ }]
116
+ }]
117
+ });
118
+ Node.registry.register('base-rect-node', CommonNode);
@@ -0,0 +1,5 @@
1
+ import BaseNode from './BaseNode';
2
+ export default class ConditionJudgment extends BaseNode {
3
+ getInPorts(): import("@antv/x6/lib/model/port").PortManager.PortMetadata[];
4
+ getOutPorts(): import("@antv/x6/lib/model/port").PortManager.PortMetadata[];
5
+ }
@@ -0,0 +1,130 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
+
5
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6
+
7
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
8
+
9
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
10
+
11
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
12
+
13
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
+
15
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
16
+
17
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
+
19
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
20
+
21
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
22
+
23
+ import BaseNode from "./BaseNode";
24
+ import { CONDITION_HEIGHT, CONDITION_WIDTH } from "../../../constants/graph";
25
+ import { Dom, Node } from '@antv/x6';
26
+
27
+ var ConditionJudgment = /*#__PURE__*/function (_BaseNode) {
28
+ _inherits(ConditionJudgment, _BaseNode);
29
+
30
+ var _super = _createSuper(ConditionJudgment);
31
+
32
+ function ConditionJudgment() {
33
+ _classCallCheck(this, ConditionJudgment);
34
+
35
+ return _super.apply(this, arguments);
36
+ }
37
+
38
+ _createClass(ConditionJudgment, [{
39
+ key: "getInPorts",
40
+ value: function getInPorts() {
41
+ return this.getPortsByGroup('in');
42
+ }
43
+ }, {
44
+ key: "getOutPorts",
45
+ value: function getOutPorts() {
46
+ return this.getPortsByGroup('out');
47
+ }
48
+ }]);
49
+
50
+ return ConditionJudgment;
51
+ }(BaseNode);
52
+
53
+ export { ConditionJudgment as default };
54
+ ConditionJudgment.config({
55
+ width: CONDITION_WIDTH,
56
+ height: CONDITION_HEIGHT,
57
+ shape: 'condition-judgement-element',
58
+ ports: {
59
+ groups: {
60
+ in: {
61
+ position: {
62
+ name: 'top'
63
+ },
64
+ zIndex: 2
65
+ },
66
+ out: {
67
+ position: {
68
+ name: 'bottom'
69
+ },
70
+ zIndex: 2
71
+ },
72
+ outLeft: {
73
+ position: {
74
+ name: 'left'
75
+ },
76
+ zIndex: 2
77
+ },
78
+ outRight: {
79
+ position: {
80
+ name: 'right'
81
+ },
82
+ zIndex: 2
83
+ }
84
+ }
85
+ },
86
+ attrs: {
87
+ body: {
88
+ magnet: false,
89
+ fill: 'none',
90
+ stroke: 'none',
91
+ refWidth: '100%',
92
+ refHeight: '100%',
93
+ zIndex: 1
94
+ }
95
+ },
96
+ portMarkup: [{
97
+ tagName: 'foreignObject',
98
+ selector: 'fo',
99
+ attrs: {
100
+ width: 8,
101
+ height: 8,
102
+ x: -4,
103
+ y: -4,
104
+ zIndex: 10,
105
+ // magnet决定是否可交互
106
+ magnet: 'true'
107
+ },
108
+ children: [{
109
+ ns: Dom.ns.xhtml,
110
+ tagName: 'body',
111
+ selector: 'foBody',
112
+ attrs: {
113
+ xmlns: Dom.ns.xhtml
114
+ },
115
+ style: {
116
+ width: '100%',
117
+ height: '100%'
118
+ },
119
+ children: [{
120
+ tagName: 'span',
121
+ selector: 'content',
122
+ style: {
123
+ width: '100%',
124
+ height: '100%'
125
+ }
126
+ }]
127
+ }]
128
+ }]
129
+ });
130
+ Node.registry.register('condition-judgement-element', ConditionJudgment);
@@ -0,0 +1,4 @@
1
+ import BaseNode from './BaseNode';
2
+ export default class GroupNode extends BaseNode {
3
+ isGroup(): boolean;
4
+ }
@@ -0,0 +1,99 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
+
5
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6
+
7
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
8
+
9
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
10
+
11
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
12
+
13
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
+
15
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
16
+
17
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
+
19
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
20
+
21
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
22
+
23
+ import BaseNode from "./BaseNode";
24
+ import { Dom } from '@antv/x6';
25
+
26
+ var GroupNode = /*#__PURE__*/function (_BaseNode) {
27
+ _inherits(GroupNode, _BaseNode);
28
+
29
+ var _super = _createSuper(GroupNode);
30
+
31
+ function GroupNode() {
32
+ _classCallCheck(this, GroupNode);
33
+
34
+ return _super.apply(this, arguments);
35
+ }
36
+
37
+ _createClass(GroupNode, [{
38
+ key: "isGroup",
39
+ value: // eslint-disable-next-line class-methods-use-this
40
+ function isGroup() {
41
+ return true;
42
+ }
43
+ }]);
44
+
45
+ return GroupNode;
46
+ }(BaseNode);
47
+
48
+ export { GroupNode as default };
49
+ GroupNode.config({
50
+ ports: {
51
+ groups: {
52
+ in: {
53
+ position: {
54
+ name: 'top'
55
+ },
56
+ zIndex: 2
57
+ },
58
+ out: {
59
+ position: {
60
+ name: 'bottom'
61
+ },
62
+ zIndex: 2
63
+ }
64
+ }
65
+ },
66
+ portMarkup: [{
67
+ tagName: 'foreignObject',
68
+ selector: 'fo',
69
+ attrs: {
70
+ width: 6,
71
+ height: 6,
72
+ x: -3,
73
+ y: -3,
74
+ zIndex: 10,
75
+ // magnet决定是否可交互
76
+ magnet: 'true'
77
+ },
78
+ children: [{
79
+ ns: Dom.ns.xhtml,
80
+ tagName: 'body',
81
+ selector: 'foBody',
82
+ attrs: {
83
+ xmlns: Dom.ns.xhtml
84
+ },
85
+ style: {
86
+ width: '100%',
87
+ height: '100%'
88
+ },
89
+ children: [{
90
+ tagName: 'span',
91
+ selector: 'content',
92
+ style: {
93
+ width: '100%',
94
+ height: '100%'
95
+ }
96
+ }]
97
+ }]
98
+ }]
99
+ });
@@ -0,0 +1,5 @@
1
+ import BaseNode from './BaseNode';
2
+ export default class ConditionJudgment extends BaseNode {
3
+ getInPorts(): import("@antv/x6/lib/model/port").PortManager.PortMetadata[];
4
+ getOutPorts(): import("@antv/x6/lib/model/port").PortManager.PortMetadata[];
5
+ }
@@ -0,0 +1,130 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
+
5
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6
+
7
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
8
+
9
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
10
+
11
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
12
+
13
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
+
15
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
16
+
17
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
+
19
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
20
+
21
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
22
+
23
+ import BaseNode from "./BaseNode";
24
+ import { LOGICAL_EDG } from "../../../constants/graph";
25
+ import { Dom, Node } from '@antv/x6';
26
+
27
+ var ConditionJudgment = /*#__PURE__*/function (_BaseNode) {
28
+ _inherits(ConditionJudgment, _BaseNode);
29
+
30
+ var _super = _createSuper(ConditionJudgment);
31
+
32
+ function ConditionJudgment() {
33
+ _classCallCheck(this, ConditionJudgment);
34
+
35
+ return _super.apply(this, arguments);
36
+ }
37
+
38
+ _createClass(ConditionJudgment, [{
39
+ key: "getInPorts",
40
+ value: function getInPorts() {
41
+ return this.getPortsByGroup('in');
42
+ }
43
+ }, {
44
+ key: "getOutPorts",
45
+ value: function getOutPorts() {
46
+ return this.getPortsByGroup('out');
47
+ }
48
+ }]);
49
+
50
+ return ConditionJudgment;
51
+ }(BaseNode);
52
+
53
+ export { ConditionJudgment as default };
54
+ ConditionJudgment.config({
55
+ width: LOGICAL_EDG,
56
+ height: LOGICAL_EDG,
57
+ shape: 'logical-element',
58
+ ports: {
59
+ groups: {
60
+ in: {
61
+ position: {
62
+ name: 'top'
63
+ },
64
+ zIndex: 2
65
+ },
66
+ out: {
67
+ position: {
68
+ name: 'bottom'
69
+ },
70
+ zIndex: 2
71
+ },
72
+ outLeft: {
73
+ position: {
74
+ name: 'left'
75
+ },
76
+ zIndex: 2
77
+ },
78
+ outRight: {
79
+ position: {
80
+ name: 'right'
81
+ },
82
+ zIndex: 2
83
+ }
84
+ }
85
+ },
86
+ attrs: {
87
+ body: {
88
+ magnet: false,
89
+ fill: 'none',
90
+ stroke: 'none',
91
+ refWidth: '100%',
92
+ refHeight: '100%',
93
+ zIndex: 1
94
+ }
95
+ },
96
+ portMarkup: [{
97
+ tagName: 'foreignObject',
98
+ selector: 'fo',
99
+ attrs: {
100
+ width: 8,
101
+ height: 8,
102
+ x: -4,
103
+ y: -4,
104
+ zIndex: 10,
105
+ // magnet决定是否可交互
106
+ magnet: 'true'
107
+ },
108
+ children: [{
109
+ ns: Dom.ns.xhtml,
110
+ tagName: 'body',
111
+ selector: 'foBody',
112
+ attrs: {
113
+ xmlns: Dom.ns.xhtml
114
+ },
115
+ style: {
116
+ width: '100%',
117
+ height: '100%'
118
+ },
119
+ children: [{
120
+ tagName: 'span',
121
+ selector: 'content',
122
+ style: {
123
+ width: '100%',
124
+ height: '100%'
125
+ }
126
+ }]
127
+ }]
128
+ }]
129
+ });
130
+ Node.registry.register('logical-element', ConditionJudgment);
@@ -0,0 +1,83 @@
1
+ interface NodeParams {
2
+ id: string;
3
+ name: string;
4
+ imgUrl: string;
5
+ x: number;
6
+ y: number;
7
+ }
8
+ export declare const createNodePorts: (id: string, timestamp: string) => {
9
+ inPorts: {
10
+ id: string;
11
+ sequence: number;
12
+ }[];
13
+ outPorts: ({
14
+ id: string;
15
+ sequence: number;
16
+ group?: undefined;
17
+ } | {
18
+ id: string;
19
+ sequence: number;
20
+ group: string;
21
+ })[];
22
+ };
23
+ export declare const createNode: ({ id, name, imgUrl, x, y }: NodeParams) => {
24
+ inPorts: {
25
+ id: string;
26
+ sequence: number;
27
+ }[];
28
+ outPorts: ({
29
+ id: string;
30
+ sequence: number;
31
+ group?: undefined;
32
+ } | {
33
+ id: string;
34
+ sequence: number;
35
+ group: string;
36
+ })[];
37
+ id: string;
38
+ name: string;
39
+ imgUrl: string;
40
+ positionX: number;
41
+ positionY: number;
42
+ };
43
+ export declare const copyNode: ({ id, name, imgUrl, x, y }: NodeParams) => {
44
+ inPorts: {
45
+ id: string;
46
+ sequence: number;
47
+ }[];
48
+ outPorts: ({
49
+ id: string;
50
+ sequence: number;
51
+ group?: undefined;
52
+ } | {
53
+ id: string;
54
+ sequence: number;
55
+ group: string;
56
+ })[];
57
+ id: string;
58
+ name: string;
59
+ imgUrl: string;
60
+ positionX: number;
61
+ positionY: number;
62
+ };
63
+ export declare const addNode: (params: NodeParams) => {
64
+ inPorts: {
65
+ id: string;
66
+ sequence: number;
67
+ }[];
68
+ outPorts: ({
69
+ id: string;
70
+ sequence: number;
71
+ group?: undefined;
72
+ } | {
73
+ id: string;
74
+ sequence: number;
75
+ group: string;
76
+ })[];
77
+ id: string;
78
+ name: string;
79
+ imgUrl: string;
80
+ positionX: number;
81
+ positionY: number;
82
+ };
83
+ export {};