@rxflow/group-bloodline 0.0.1-alpha.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 (106) hide show
  1. package/README.md +41 -0
  2. package/cjs/components/Connector.d.ts +16 -0
  3. package/cjs/components/Connector.d.ts.map +1 -0
  4. package/cjs/components/Connector.js +152 -0
  5. package/cjs/components/Version.d.ts +11 -0
  6. package/cjs/components/Version.d.ts.map +1 -0
  7. package/cjs/components/Version.js +44 -0
  8. package/cjs/constants.d.ts +22 -0
  9. package/cjs/constants.d.ts.map +1 -0
  10. package/cjs/constants.js +30 -0
  11. package/cjs/index.d.ts +7 -0
  12. package/cjs/index.d.ts.map +1 -0
  13. package/cjs/index.js +71 -0
  14. package/cjs/nodes/DepthToolNode/index.d.ts +7 -0
  15. package/cjs/nodes/DepthToolNode/index.d.ts.map +1 -0
  16. package/cjs/nodes/DepthToolNode/index.js +152 -0
  17. package/cjs/nodes/DepthToolNode/index.less +19 -0
  18. package/cjs/nodes/Service/MultipleVersionService.d.ts +6 -0
  19. package/cjs/nodes/Service/MultipleVersionService.d.ts.map +1 -0
  20. package/cjs/nodes/Service/MultipleVersionService.js +84 -0
  21. package/cjs/nodes/Service/SingleVersionService.d.ts +6 -0
  22. package/cjs/nodes/Service/SingleVersionService.d.ts.map +1 -0
  23. package/cjs/nodes/Service/SingleVersionService.js +76 -0
  24. package/cjs/nodes/Service/index.d.ts +17 -0
  25. package/cjs/nodes/Service/index.d.ts.map +1 -0
  26. package/cjs/nodes/Service/index.js +71 -0
  27. package/cjs/nodes/ServiceGroup/index.d.ts +6 -0
  28. package/cjs/nodes/ServiceGroup/index.d.ts.map +1 -0
  29. package/cjs/nodes/ServiceGroup/index.js +192 -0
  30. package/cjs/nodes/index.d.ts +10 -0
  31. package/cjs/nodes/index.d.ts.map +1 -0
  32. package/cjs/nodes/index.js +43 -0
  33. package/cjs/style/index.less +220 -0
  34. package/cjs/style/index.module.less +212 -0
  35. package/cjs/style/theme.less +16 -0
  36. package/cjs/types.d.ts +102 -0
  37. package/cjs/types.d.ts.map +1 -0
  38. package/cjs/types.js +5 -0
  39. package/cjs/utils/bloodLayout.d.ts +15 -0
  40. package/cjs/utils/bloodLayout.d.ts.map +1 -0
  41. package/cjs/utils/bloodLayout.js +316 -0
  42. package/cjs/utils/countSiblings.d.ts +10 -0
  43. package/cjs/utils/countSiblings.d.ts.map +1 -0
  44. package/cjs/utils/countSiblings.js +32 -0
  45. package/cjs/utils/getVersion.d.ts +3 -0
  46. package/cjs/utils/getVersion.d.ts.map +1 -0
  47. package/cjs/utils/getVersion.js +24 -0
  48. package/cjs/utils/keys.d.ts +3 -0
  49. package/cjs/utils/keys.d.ts.map +1 -0
  50. package/cjs/utils/keys.js +18 -0
  51. package/cjs/utils/shadowNodeData.d.ts +10 -0
  52. package/cjs/utils/shadowNodeData.d.ts.map +1 -0
  53. package/cjs/utils/shadowNodeData.js +18 -0
  54. package/esm/components/Connector.d.ts +16 -0
  55. package/esm/components/Connector.d.ts.map +1 -0
  56. package/esm/components/Connector.js +168 -0
  57. package/esm/components/Version.d.ts +11 -0
  58. package/esm/components/Version.d.ts.map +1 -0
  59. package/esm/components/Version.js +36 -0
  60. package/esm/constants.d.ts +22 -0
  61. package/esm/constants.d.ts.map +1 -0
  62. package/esm/constants.js +25 -0
  63. package/esm/index.d.ts +7 -0
  64. package/esm/index.d.ts.map +1 -0
  65. package/esm/index.js +45 -0
  66. package/esm/nodes/DepthToolNode/index.d.ts +7 -0
  67. package/esm/nodes/DepthToolNode/index.d.ts.map +1 -0
  68. package/esm/nodes/DepthToolNode/index.js +220 -0
  69. package/esm/nodes/DepthToolNode/index.less +19 -0
  70. package/esm/nodes/Service/MultipleVersionService.d.ts +6 -0
  71. package/esm/nodes/Service/MultipleVersionService.d.ts.map +1 -0
  72. package/esm/nodes/Service/MultipleVersionService.js +74 -0
  73. package/esm/nodes/Service/SingleVersionService.d.ts +6 -0
  74. package/esm/nodes/Service/SingleVersionService.d.ts.map +1 -0
  75. package/esm/nodes/Service/SingleVersionService.js +67 -0
  76. package/esm/nodes/Service/index.d.ts +17 -0
  77. package/esm/nodes/Service/index.d.ts.map +1 -0
  78. package/esm/nodes/Service/index.js +57 -0
  79. package/esm/nodes/ServiceGroup/index.d.ts +6 -0
  80. package/esm/nodes/ServiceGroup/index.d.ts.map +1 -0
  81. package/esm/nodes/ServiceGroup/index.js +201 -0
  82. package/esm/nodes/index.d.ts +10 -0
  83. package/esm/nodes/index.d.ts.map +1 -0
  84. package/esm/nodes/index.js +36 -0
  85. package/esm/style/index.less +220 -0
  86. package/esm/style/index.module.less +212 -0
  87. package/esm/style/theme.less +16 -0
  88. package/esm/types.d.ts +102 -0
  89. package/esm/types.d.ts.map +1 -0
  90. package/esm/types.js +1 -0
  91. package/esm/utils/bloodLayout.d.ts +15 -0
  92. package/esm/utils/bloodLayout.d.ts.map +1 -0
  93. package/esm/utils/bloodLayout.js +304 -0
  94. package/esm/utils/countSiblings.d.ts +10 -0
  95. package/esm/utils/countSiblings.d.ts.map +1 -0
  96. package/esm/utils/countSiblings.js +23 -0
  97. package/esm/utils/getVersion.d.ts +3 -0
  98. package/esm/utils/getVersion.d.ts.map +1 -0
  99. package/esm/utils/getVersion.js +17 -0
  100. package/esm/utils/keys.d.ts +3 -0
  101. package/esm/utils/keys.d.ts.map +1 -0
  102. package/esm/utils/keys.js +11 -0
  103. package/esm/utils/shadowNodeData.d.ts +10 -0
  104. package/esm/utils/shadowNodeData.d.ts.map +1 -0
  105. package/esm/utils/shadowNodeData.js +11 -0
  106. package/package.json +50 -0
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.MultipleVersionRender = void 0;
7
+ var _base = require("@rxflow/base");
8
+ var _ = require("../..");
9
+ require("../../style/index.less");
10
+ var _classcat = _interopRequireDefault(require("classcat"));
11
+ var _react = _interopRequireDefault(require("react"));
12
+ var _Connector = require("../../components/Connector");
13
+ var _Version = require("../../components/Version");
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+ /**
17
+ * @author: yanxianliang
18
+ * @date: 2025-07-05 16:23
19
+ * @desc: 多版本节点
20
+ *
21
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
22
+ */
23
+
24
+ const prefixCls = 'rxflow-group-bloodline';
25
+ const MultipleVersionRender = props => {
26
+ const {
27
+ origin,
28
+ siblings,
29
+ isRoot,
30
+ depth
31
+ } = props;
32
+ const {
33
+ name,
34
+ versions,
35
+ hit
36
+ } = origin;
37
+ const getProps = (0, _base.useGetProps)();
38
+ const PropertyPopover = getProps().PropertyPopover;
39
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
40
+ className: (0, _classcat.default)([`${prefixCls}-service`, {
41
+ [`${prefixCls}-hit`]: hit
42
+ }]),
43
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
44
+ className: `${prefixCls}-node_name`,
45
+ children: name
46
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
47
+ className: `${prefixCls}-versions`,
48
+ children: versions.map((version, index) => {
49
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
50
+ className: `${prefixCls}-version-box`,
51
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Connector.Connector, {
52
+ depth: depth,
53
+ isRoot: isRoot,
54
+ version: version,
55
+ source: origin,
56
+ siblings: siblings,
57
+ direction: _.BloodlineDirection.upstream
58
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_base.Popover, {
59
+ rootClassName: `${prefixCls}-popover`,
60
+ placement: 'right',
61
+ content: /*#__PURE__*/(0, _jsxRuntime.jsx)(PropertyPopover, {
62
+ origin: origin,
63
+ version: version,
64
+ isRoot: isRoot
65
+ }),
66
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
67
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Version.Version, {
68
+ ...version
69
+ })
70
+ })
71
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Connector.Connector, {
72
+ depth: depth,
73
+ isRoot: isRoot,
74
+ version: version,
75
+ source: origin,
76
+ siblings: siblings,
77
+ direction: _.BloodlineDirection.downstream
78
+ })]
79
+ }, index);
80
+ })
81
+ })]
82
+ });
83
+ };
84
+ exports.MultipleVersionRender = MultipleVersionRender;
@@ -0,0 +1,6 @@
1
+ import { InnerNodeData, MultipleVersionsNodeData } from "../..";
2
+ import '../../style/index.less';
3
+ export declare const SingleVersionNodeRender: (props: MultipleVersionsNodeData & InnerNodeData & {
4
+ measure?: boolean;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=SingleVersionService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SingleVersionService.d.ts","sourceRoot":"","sources":["SingleVersionService.tsx"],"names":[],"mappings":"AAQA,OAAO,EAA2B,aAAa,EAAE,wBAAwB,EAAC,cAAgC;AAE1G,OAAO,wBAAwB,CAAC;AAQhC,eAAO,MAAM,uBAAuB,UAAW,wBAAwB,GAAG,aAAa,GAAG;IACxF,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,4CAwCA,CAAA"}
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SingleVersionNodeRender = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _base = require("@rxflow/base");
9
+ require("../../style/index.less");
10
+ var _Version = require("../../components/Version");
11
+ var _Connector = require("../../components/Connector");
12
+ var _ = require("../..");
13
+ var _classcat = _interopRequireDefault(require("classcat"));
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
+ /**
17
+ * @author: yanxianliang
18
+ * @date: 2025-07-05 14:58
19
+ * @desc: 单版本节点
20
+ *
21
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
22
+ */
23
+
24
+ const prefixCls = 'rxflow-group-bloodline';
25
+ const SingleVersionNodeRender = props => {
26
+ const {
27
+ origin,
28
+ siblings,
29
+ isRoot,
30
+ depth
31
+ } = props;
32
+ const {
33
+ name,
34
+ hit
35
+ } = origin;
36
+ const getProps = (0, _base.useGetProps)();
37
+ const PropertyPopover = getProps().PropertyPopover;
38
+ const version = origin.versions?.[0];
39
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
40
+ className: (0, _classcat.default)([`${prefixCls}-service`, {
41
+ [`${prefixCls}-hit`]: hit
42
+ }]),
43
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Connector.Connector, {
44
+ depth: depth,
45
+ isRoot: isRoot,
46
+ version: version,
47
+ source: origin,
48
+ siblings: siblings,
49
+ direction: _.BloodlineDirection.upstream
50
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_base.Popover, {
51
+ rootClassName: `${prefixCls}-popover`,
52
+ placement: 'right',
53
+ content: /*#__PURE__*/(0, _jsxRuntime.jsx)(PropertyPopover, {
54
+ origin: origin,
55
+ version: version,
56
+ isRoot: isRoot
57
+ }),
58
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
59
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
60
+ className: `${prefixCls}-node_name`,
61
+ children: name
62
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Version.Version, {
63
+ ...version
64
+ })]
65
+ })
66
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Connector.Connector, {
67
+ depth: depth,
68
+ isRoot: isRoot,
69
+ version: version,
70
+ source: origin,
71
+ siblings: siblings,
72
+ direction: _.BloodlineDirection.downstream
73
+ })]
74
+ });
75
+ };
76
+ exports.SingleVersionNodeRender = SingleVersionNodeRender;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @author: yanxianliang
3
+ * @date: 2025-07-05 21:56
4
+ * @desc: ServiceNode
5
+ *
6
+ * 支持单版本和多版本
7
+ *
8
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
9
+ */
10
+ import React from "react";
11
+ import { Node, NodeProps } from "@xyflow/react";
12
+ import { InnerNodeData, ServiceNodeData } from "../..";
13
+ export declare const ServiceRender: (props: ServiceNodeData & InnerNodeData & {
14
+ measure?: boolean;
15
+ }) => import("react/jsx-runtime").JSX.Element;
16
+ export declare const Service: React.MemoExoticComponent<(props: NodeProps<Node<ServiceNodeData & InnerNodeData>>) => import("react/jsx-runtime").JSX.Element>;
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,IAAI,EAAE,SAAS,EAAC,MAAM,eAAe,CAAC;AAC9C,OAAO,EAA6B,aAAa,EAAE,eAAe,EAAC,cAAgC;AAMnG,eAAO,MAAM,aAAa,UAAW,eAAe,GAAG,aAAa,GAAG;IACrE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,4CAwBA,CAAA;AAGD,eAAO,MAAM,OAAO,oCAAsB,UAAU,KAAK,eAAe,GAAG,aAAa,CAAC,CAAC,6CAaxE,CAAC"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ServiceRender = exports.Service = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _shadowNodeData = require("../../utils/shadowNodeData");
9
+ var _SingleVersionService = require("./SingleVersionService");
10
+ var _MultipleVersionService = require("./MultipleVersionService");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+ /**
14
+ * @author: yanxianliang
15
+ * @date: 2025-07-05 21:56
16
+ * @desc: ServiceNode
17
+ *
18
+ * 支持单版本和多版本
19
+ *
20
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
21
+ */
22
+
23
+ const ServiceRender = props => {
24
+ const {
25
+ origin,
26
+ measure,
27
+ siblings,
28
+ direction,
29
+ isRoot,
30
+ depth
31
+ } = props;
32
+ if (origin.versions?.length > 1) {
33
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_MultipleVersionService.MultipleVersionRender, {
34
+ depth: depth,
35
+ isRoot: isRoot,
36
+ direction: direction,
37
+ measure: measure,
38
+ origin: origin,
39
+ siblings: siblings
40
+ });
41
+ }
42
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SingleVersionService.SingleVersionNodeRender, {
43
+ depth: depth,
44
+ isRoot: isRoot,
45
+ direction: direction,
46
+ measure: measure,
47
+ origin: origin,
48
+ siblings: siblings
49
+ });
50
+ };
51
+ exports.ServiceRender = ServiceRender;
52
+ const Service = exports.Service = /*#__PURE__*/_react.default.memo(props => {
53
+ const {
54
+ data
55
+ } = props;
56
+ const {
57
+ origin,
58
+ siblings,
59
+ direction,
60
+ isRoot,
61
+ depth
62
+ } = data;
63
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(ServiceRender, {
64
+ depth: depth,
65
+ direction: direction,
66
+ isRoot: isRoot,
67
+ measure: true,
68
+ origin: origin,
69
+ siblings: siblings
70
+ });
71
+ }, _shadowNodeData.shadowNodeData);
@@ -0,0 +1,6 @@
1
+ import { GroupNodeData, InnerNodeData } from "../..";
2
+ import '../../style/index.less';
3
+ import { Node, NodeProps } from "@xyflow/react";
4
+ import React from "react";
5
+ export declare const ServiceGroup: React.MemoExoticComponent<(props: NodeProps<Node<GroupNodeData & InnerNodeData>>) => import("react/jsx-runtime").JSX.Element>;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAC,aAAa,EAA4B,aAAa,EAAC,cAAgC;AAE/F,OAAO,wBAAwB,CAAC;AAChC,OAAO,EAAC,IAAI,EAAE,SAAS,EAAmC,MAAM,eAAe,CAAC;AAKhF,OAAO,KAA2B,MAAM,OAAO,CAAC;AAQhD,eAAO,MAAM,YAAY,oCAAsB,UAAU,KAAK,aAAa,GAAG,aAAa,CAAC,CAAC,6CAwJ3E,CAAC"}
@@ -0,0 +1,192 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ServiceGroup = void 0;
7
+ var _ArrowsAltOutlined = _interopRequireDefault(require("@ant-design/icons/ArrowsAltOutlined"));
8
+ var _base = require("@rxflow/base");
9
+ require("../../style/index.less");
10
+ var _react = require("@xyflow/react");
11
+ var _ahooks = require("ahooks");
12
+ var _antd = require("antd");
13
+ var _classcat = _interopRequireDefault(require("classcat"));
14
+ var _lodash = require("lodash");
15
+ var _react2 = _interopRequireWildcard(require("react"));
16
+ var _constants = require("../../constants");
17
+ var _keys = require("../../utils/keys");
18
+ var _shadowNodeData = require("../../utils/shadowNodeData");
19
+ var _Service = require("../Service");
20
+ var _jsxRuntime = require("react/jsx-runtime");
21
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
22
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
23
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
+ /**
25
+ * @author: yanxianliang
26
+ * @date: 2025-07-05 16:36
27
+ * @desc: $Desc$
28
+ *
29
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
30
+ */
31
+
32
+ const prefixCls = 'rxflow-group-bloodline';
33
+ const ServiceGroup = exports.ServiceGroup = /*#__PURE__*/_react2.default.memo(props => {
34
+ const {
35
+ data,
36
+ id
37
+ } = props;
38
+ const {
39
+ origin,
40
+ siblings,
41
+ direction,
42
+ isRoot,
43
+ depth
44
+ } = data;
45
+ const {
46
+ name,
47
+ count
48
+ } = origin;
49
+ const getProps = (0, _base.useGetProps)();
50
+ const update = (0, _ahooks.useUpdate)();
51
+ const triggerLayout = (0, _base.useForceUpdate)();
52
+ const {
53
+ expanded = false,
54
+ loading = false,
55
+ list = [],
56
+ current = 1,
57
+ total = 0
58
+ } = origin.state || {};
59
+ const updateNodeInternals = (0, _react.useUpdateNodeInternals)(); // 重新解析handles
60
+
61
+ const {
62
+ run
63
+ } = (0, _ahooks.useRequest)(async params => {
64
+ (0, _lodash.set)(origin, ['state', 'loading'], true);
65
+ update();
66
+ const {
67
+ current,
68
+ pageSize
69
+ } = params;
70
+ const getChildren = getProps().getChildren;
71
+ try {
72
+ const {
73
+ total,
74
+ list
75
+ } = await getChildren?.(origin, pageSize, current, direction);
76
+ (0, _lodash.set)(origin, ['state', 'loading'], false);
77
+ (0, _lodash.set)(origin, ['state', 'current'], current);
78
+ (0, _lodash.set)(origin, ['state', 'total'], total);
79
+ (0, _lodash.set)(origin, ['state', 'list'], list);
80
+ triggerLayout();
81
+ } catch (e) {
82
+ (0, _lodash.set)(origin, ['state', 'loading'], false);
83
+ update();
84
+ }
85
+ }, {
86
+ manual: true
87
+ });
88
+ const onExpand = (0, _ahooks.useMemoizedFn)(() => {
89
+ (0, _lodash.set)(origin, ['state', 'expanded'], true);
90
+ update();
91
+ if (!origin.state?.list) {
92
+ run({
93
+ current: 1,
94
+ pageSize: _constants.groupPageSize
95
+ });
96
+ }
97
+ });
98
+ const onCollapse = (0, _ahooks.useMemoizedFn)(() => {
99
+ (0, _lodash.set)(origin, ['state', 'expanded'], false);
100
+ update();
101
+ });
102
+ const onPaginationChange = (0, _ahooks.useMemoizedFn)((current, pageSize) => {
103
+ run({
104
+ current,
105
+ pageSize
106
+ });
107
+ });
108
+ (0, _react2.useEffect)(() => {
109
+ updateNodeInternals(id);
110
+ }, [list]);
111
+ const groupInfo = (0, _react2.useMemo)(() => {
112
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
113
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
114
+ className: `${prefixCls}-group_title`,
115
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_base.Tooltip, {
116
+ title: name,
117
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
118
+ children: name
119
+ })
120
+ })
121
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
122
+ className: `${prefixCls}-group_count`,
123
+ children: [count || 0, "\u4E2A"]
124
+ })]
125
+ });
126
+ }, [name, count]);
127
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
128
+ className: (0, _classcat.default)([`${prefixCls}-group`, {
129
+ [`${prefixCls}-expanded`]: expanded
130
+ }]),
131
+ onClick: expanded ? undefined : onExpand,
132
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_base.HiddenHandle, {
133
+ type: 'target',
134
+ position: _react.Position.Left,
135
+ id: (0, _keys.getConnectorId)(_constants.BloodlineDirection.upstream, id)
136
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_base.HiddenHandle, {
137
+ type: "source",
138
+ position: _react.Position.Right,
139
+ id: (0, _keys.getConnectorId)(_constants.BloodlineDirection.downstream, id)
140
+ }), expanded ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
141
+ className: `${prefixCls}-expanded-content`,
142
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
143
+ className: `${prefixCls}-title_bar`,
144
+ children: [groupInfo, /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
145
+ className: `${prefixCls}-group_icon`,
146
+ onClick: onCollapse,
147
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ArrowsAltOutlined.default, {})
148
+ })]
149
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
150
+ className: `${prefixCls}-group_content`,
151
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Spin, {
152
+ size: 'small',
153
+ spinning: loading,
154
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
155
+ className: `${prefixCls}--group_items`,
156
+ children: list?.map(node => {
157
+ const {
158
+ type,
159
+ id
160
+ } = node;
161
+ switch (type) {
162
+ case _constants.BloodlineNodeType.Service:
163
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Service.ServiceRender, {
164
+ depth: depth,
165
+ isRoot: isRoot,
166
+ direction: direction,
167
+ origin: node,
168
+ siblings: siblings
169
+ }, id);
170
+ default:
171
+ return null;
172
+ }
173
+ })
174
+ })
175
+ }), total > _constants.groupPageSize ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Pagination, {
176
+ current: current,
177
+ pageSize: _constants.groupPageSize,
178
+ onChange: onPaginationChange,
179
+ total: total,
180
+ showSizeChanger: false,
181
+ showQuickJumper: false,
182
+ showLessItems: true,
183
+ size: 'small',
184
+ rootClassName: `${prefixCls}-pagination`
185
+ }) : null]
186
+ })]
187
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
188
+ className: `${prefixCls}-group_base`,
189
+ children: groupInfo
190
+ })]
191
+ });
192
+ }, _shadowNodeData.shadowNodeData);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @author: yanxianliang
3
+ * @date: 2025-07-03 12:22
4
+ * @desc: 节点类型定义
5
+ *
6
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
7
+ */
8
+ import { INodeDefinition } from "@rxflow/base";
9
+ export declare const nodeTypes: INodeDefinition<any>[];
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAM7C,eAAO,MAAM,SAAS,EAAE,eAAe,CAAC,GAAG,CAAC,EAyB3C,CAAC"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.nodeTypes = void 0;
7
+ var _DepthToolNode = _interopRequireDefault(require("./DepthToolNode"));
8
+ var _ServiceGroup = require("./ServiceGroup");
9
+ var _constants = require("../constants");
10
+ var _Service = require("./Service");
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
+ /**
13
+ * @author: yanxianliang
14
+ * @date: 2025-07-03 12:22
15
+ * @desc: 节点类型定义
16
+ *
17
+ * Copyright (c) 2025 by yanxianliang, All Rights Reserved.
18
+ */
19
+
20
+ const nodeTypes = exports.nodeTypes = [{
21
+ type: _constants.BloodlineNodeType.Toolbar,
22
+ // 是不是可以不配置,直接在节点中引入了
23
+ component: _DepthToolNode.default,
24
+ defaultSize: {
25
+ width: 400,
26
+ height: 24
27
+ }
28
+ }, {
29
+ type: _constants.BloodlineNodeType.Service,
30
+ component: _Service.Service,
31
+ defaultSize: {
32
+ width: 238,
33
+ // 宽度为238
34
+ height: 64 // 高度默认为64。如果有子版本号,高度会变化
35
+ }
36
+ }, {
37
+ type: _constants.BloodlineNodeType.ServiceGroup,
38
+ component: _ServiceGroup.ServiceGroup,
39
+ defaultSize: {
40
+ width: 265,
41
+ height: 78
42
+ }
43
+ }];