@rxflow/group-bloodline 0.0.4-alpha.6 → 0.0.4-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/Connector.js +2 -2
- package/cjs/hooks/useGroupBloodlineProps.d.ts +11 -27
- package/cjs/hooks/useGroupBloodlineProps.d.ts.map +1 -1
- package/cjs/hooks/useGroupBloodlineProps.js +13 -34
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +3 -10
- package/cjs/nodes/DepthToolNode/index.js +2 -2
- package/cjs/nodes/Service/MultipleVersionService.js +2 -2
- package/cjs/nodes/Service/SingleVersionService.js +2 -2
- package/cjs/nodes/ServiceGroup/index.js +3 -3
- package/esm/components/Connector.js +4 -4
- package/esm/hooks/useGroupBloodlineProps.d.ts +11 -27
- package/esm/hooks/useGroupBloodlineProps.d.ts.map +1 -1
- package/esm/hooks/useGroupBloodlineProps.js +11 -30
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +3 -11
- package/esm/nodes/DepthToolNode/index.js +3 -3
- package/esm/nodes/Service/MultipleVersionService.js +3 -3
- package/esm/nodes/Service/SingleVersionService.js +3 -3
- package/esm/nodes/ServiceGroup/index.js +4 -4
- package/package.json +2 -2
|
@@ -69,7 +69,7 @@ const Connector = ({
|
|
|
69
69
|
}) => {
|
|
70
70
|
const update = (0, _ahooks.useUpdate)();
|
|
71
71
|
const triggerLayout = (0, _base.useForceUpdate)();
|
|
72
|
-
const
|
|
72
|
+
const getProps = (0, _base.useGetFlowProps)();
|
|
73
73
|
const config = version[direction];
|
|
74
74
|
const connectorState = (0, _react2.useMemo)(() => {
|
|
75
75
|
return getStateWithDefault(config);
|
|
@@ -102,7 +102,7 @@ const Connector = ({
|
|
|
102
102
|
} else {
|
|
103
103
|
config.state = 'loading';
|
|
104
104
|
update(); // 变成加载状态
|
|
105
|
-
|
|
105
|
+
getProps().getRelation?.(direction, source, version).then(({
|
|
106
106
|
count,
|
|
107
107
|
list
|
|
108
108
|
}) => {
|
|
@@ -7,39 +7,23 @@
|
|
|
7
7
|
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
8
|
*/
|
|
9
9
|
import { IBaseFlowProps } from '@rxflow/base';
|
|
10
|
-
import {
|
|
11
|
-
type
|
|
10
|
+
import { GroupBloodlineExtendProps } from '../types';
|
|
11
|
+
type GroupBloodlineFullProps = IBaseFlowProps & GroupBloodlineExtendProps;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* 获取 Flow props
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
|
-
* const
|
|
17
|
-
* const root =
|
|
16
|
+
* const props = useGroupBloodlineProps();
|
|
17
|
+
* const root = useGroupBloodlineProps(state => state.root);
|
|
18
18
|
*/
|
|
19
|
-
export declare function
|
|
20
|
-
export declare function
|
|
19
|
+
export declare function useGroupBloodlineProps(): GroupBloodlineFullProps;
|
|
20
|
+
export declare function useGroupBloodlineProps<U>(selector: (state: GroupBloodlineFullProps) => U): U;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* const flowProps = useGroupBloodlineFlowProps();
|
|
26
|
-
* const nodes = useGroupBloodlineFlowProps(state => state.nodes);
|
|
27
|
-
*/
|
|
28
|
-
export declare function useGroupBloodlineFlowProps(): GroupBloodlineFullFlowProps;
|
|
29
|
-
export declare function useGroupBloodlineFlowProps<U>(selector: (state: GroupBloodlineFullFlowProps) => U): U;
|
|
30
|
-
/**
|
|
31
|
-
* 获取原始输入 props 的 getter(非响应式)
|
|
32
|
-
*/
|
|
33
|
-
export declare const useGetGroupBloodlineInputProps: () => {
|
|
34
|
-
(): IGroupBloodlineFlowProps;
|
|
35
|
-
<U>(selector: (state: IGroupBloodlineFlowProps) => U): U;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* 获取转换后 Flow props 的 getter(非响应式)
|
|
22
|
+
* 获取 Flow props 的 getter(非响应式)
|
|
39
23
|
*/
|
|
40
|
-
export declare const
|
|
41
|
-
():
|
|
42
|
-
<U>(selector: (state:
|
|
24
|
+
export declare const useGetGroupBloodlineProps: () => {
|
|
25
|
+
(): GroupBloodlineFullProps;
|
|
26
|
+
<U>(selector: (state: GroupBloodlineFullProps) => U): U;
|
|
43
27
|
};
|
|
44
28
|
/**
|
|
45
29
|
* 获取 root 节点数据
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGroupBloodlineProps.d.ts","sourceRoot":"","sources":["useGroupBloodlineProps.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"useGroupBloodlineProps.d.ts","sourceRoot":"","sources":["useGroupBloodlineProps.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;AACH,OAAO,EAAiC,cAAc,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAA4B,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAE/E,KAAK,uBAAuB,GAAG,cAAc,GAAG,yBAAyB,CAAC;AAE1E;;;;;;GAMG;AACH,wBAAgB,sBAAsB,IAAI,uBAAuB,CAAC;AAClE,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,CAAC,GAAG,CAAC,CAAC;AAK9F;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;CAErC,CAAC;AAGF;;GAEG;AACH,eAAO,MAAM,qBAAqB,iEAAoD,CAAC;AAEvF;;GAEG;AACH,eAAO,MAAM,mBAAmB,+MAA2D,CAAC;AAE5F;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;EAA2D,CAAC;AAE5F;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;EAA+D,CAAC"}
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.useGroupBloodlineInputProps = useGroupBloodlineInputProps;
|
|
6
|
+
exports.useGetGroupBloodlineProps = void 0;
|
|
7
|
+
exports.useGroupBloodlineProps = useGroupBloodlineProps;
|
|
9
8
|
exports.usePropertyPopover = exports.useGroupGetRelation = exports.useGroupGetChildren = exports.useGroupBloodlineRoot = void 0;
|
|
10
9
|
var _base = require("@rxflow/base");
|
|
11
10
|
/**
|
|
@@ -17,41 +16,21 @@ var _base = require("@rxflow/base");
|
|
|
17
16
|
*/
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
|
-
*
|
|
19
|
+
* 获取 Flow props
|
|
21
20
|
*
|
|
22
21
|
* @example
|
|
23
|
-
* const
|
|
24
|
-
* const root =
|
|
22
|
+
* const props = useGroupBloodlineProps();
|
|
23
|
+
* const root = useGroupBloodlineProps(state => state.root);
|
|
25
24
|
*/
|
|
26
25
|
|
|
27
|
-
function
|
|
28
|
-
return (0, _base.useInputProps)(selector);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* 获取转换后的 Flow props
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* const flowProps = useGroupBloodlineFlowProps();
|
|
36
|
-
* const nodes = useGroupBloodlineFlowProps(state => state.nodes);
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
|
-
function useGroupBloodlineFlowProps(selector) {
|
|
26
|
+
function useGroupBloodlineProps(selector) {
|
|
40
27
|
return (0, _base.useFlowProps)(selector);
|
|
41
28
|
}
|
|
42
29
|
|
|
43
30
|
/**
|
|
44
|
-
*
|
|
45
|
-
*/
|
|
46
|
-
const useGetGroupBloodlineInputProps = () => {
|
|
47
|
-
return (0, _base.useGetInputProps)();
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* 获取转换后 Flow props 的 getter(非响应式)
|
|
31
|
+
* 获取 Flow props 的 getter(非响应式)
|
|
52
32
|
*/
|
|
53
|
-
|
|
54
|
-
const useGetGroupBloodlineFlowProps = () => {
|
|
33
|
+
const useGetGroupBloodlineProps = () => {
|
|
55
34
|
return (0, _base.useGetFlowProps)();
|
|
56
35
|
};
|
|
57
36
|
|
|
@@ -59,24 +38,24 @@ const useGetGroupBloodlineFlowProps = () => {
|
|
|
59
38
|
/**
|
|
60
39
|
* 获取 root 节点数据
|
|
61
40
|
*/
|
|
62
|
-
exports.
|
|
63
|
-
const useGroupBloodlineRoot = () =>
|
|
41
|
+
exports.useGetGroupBloodlineProps = useGetGroupBloodlineProps;
|
|
42
|
+
const useGroupBloodlineRoot = () => useGroupBloodlineProps(state => state.root);
|
|
64
43
|
|
|
65
44
|
/**
|
|
66
45
|
* 获取异步加载关联节点的函数
|
|
67
46
|
*/
|
|
68
47
|
exports.useGroupBloodlineRoot = useGroupBloodlineRoot;
|
|
69
|
-
const useGroupGetRelation = () =>
|
|
48
|
+
const useGroupGetRelation = () => useGroupBloodlineProps(state => state.getRelation);
|
|
70
49
|
|
|
71
50
|
/**
|
|
72
51
|
* 获取异步加载子节点的函数
|
|
73
52
|
*/
|
|
74
53
|
exports.useGroupGetRelation = useGroupGetRelation;
|
|
75
|
-
const useGroupGetChildren = () =>
|
|
54
|
+
const useGroupGetChildren = () => useGroupBloodlineProps(state => state.getChildren);
|
|
76
55
|
|
|
77
56
|
/**
|
|
78
57
|
* 获取属性弹窗组件
|
|
79
58
|
*/
|
|
80
59
|
exports.useGroupGetChildren = useGroupGetChildren;
|
|
81
|
-
const usePropertyPopover = () =>
|
|
60
|
+
const usePropertyPopover = () => useGroupBloodlineProps(state => state.PropertyPopover);
|
|
82
61
|
exports.usePropertyPopover = usePropertyPopover;
|
package/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAGnD,OAAO,EAA6B,wBAAwB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAGnD,OAAO,EAA6B,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAuC9E,QAAA,MAAM,kBAAkB,iGAGvB,CAAC;AAEF,eAAe,kBAAkB,CAAC;AAGlC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAG5B,cAAc,gCAAgC,CAAC"}
|
package/cjs/index.js
CHANGED
|
@@ -66,8 +66,7 @@ const defaultFitViewOptions = {
|
|
|
66
66
|
const useGroupBloodlinePropsTransform = props => {
|
|
67
67
|
const {
|
|
68
68
|
root,
|
|
69
|
-
fitViewOptions: userFitViewOptions
|
|
70
|
-
flowProps: userFlowProps
|
|
69
|
+
fitViewOptions: userFitViewOptions
|
|
71
70
|
} = props;
|
|
72
71
|
|
|
73
72
|
// 将 root 转换为 nodes(放在外层)
|
|
@@ -80,12 +79,6 @@ const useGroupBloodlinePropsTransform = props => {
|
|
|
80
79
|
...defaultFitViewOptions,
|
|
81
80
|
...userFitViewOptions
|
|
82
81
|
}), [userFitViewOptions]);
|
|
83
|
-
|
|
84
|
-
// 合并 flowProps(不常用的配置)
|
|
85
|
-
const flowProps = (0, _react.useMemo)(() => ({
|
|
86
|
-
edgesFocusable: false,
|
|
87
|
-
...userFlowProps
|
|
88
|
-
}), [userFlowProps]);
|
|
89
82
|
return {
|
|
90
83
|
...props,
|
|
91
84
|
nodes,
|
|
@@ -97,8 +90,8 @@ const useGroupBloodlinePropsTransform = props => {
|
|
|
97
90
|
selectionOnDrag: false,
|
|
98
91
|
minZoom: 1,
|
|
99
92
|
maxZoom: 1,
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
edgesFocusable: false,
|
|
94
|
+
fitViewOptions
|
|
102
95
|
};
|
|
103
96
|
};
|
|
104
97
|
const GroupBloodlineFlow = (0, _base.createFlow)(_base.Flow, useGroupBloodlinePropsTransform);
|
|
@@ -47,7 +47,7 @@ const ToolbarNode = /*#__PURE__*/(0, _react.memo)(props => {
|
|
|
47
47
|
siblings = []
|
|
48
48
|
} = data || {};
|
|
49
49
|
const triggerLayout = (0, _base.useForceUpdate)();
|
|
50
|
-
const
|
|
50
|
+
const getProps = (0, _base.useGetFlowProps)();
|
|
51
51
|
const {
|
|
52
52
|
run: doLayout
|
|
53
53
|
} = (0, _ahooks.useDebounceFn)(() => {
|
|
@@ -73,7 +73,7 @@ const ToolbarNode = /*#__PURE__*/(0, _react.memo)(props => {
|
|
|
73
73
|
waitRelayout = true;
|
|
74
74
|
syncTasks.push((async () => {
|
|
75
75
|
try {
|
|
76
|
-
const getChildren =
|
|
76
|
+
const getChildren = getProps().getChildren;
|
|
77
77
|
const {
|
|
78
78
|
total,
|
|
79
79
|
list
|
|
@@ -34,8 +34,8 @@ const MultipleVersionRender = props => {
|
|
|
34
34
|
versions,
|
|
35
35
|
hit
|
|
36
36
|
} = origin;
|
|
37
|
-
const
|
|
38
|
-
const PropertyPopover =
|
|
37
|
+
const getProps = (0, _base.useGetFlowProps)();
|
|
38
|
+
const PropertyPopover = getProps().PropertyPopover;
|
|
39
39
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
40
40
|
className: (0, _classcat.default)([`${prefixCls}-service`, {
|
|
41
41
|
[`${prefixCls}-hit`]: hit
|
|
@@ -33,8 +33,8 @@ const SingleVersionNodeRender = props => {
|
|
|
33
33
|
name,
|
|
34
34
|
hit
|
|
35
35
|
} = origin;
|
|
36
|
-
const
|
|
37
|
-
const PropertyPopover =
|
|
36
|
+
const getProps = (0, _base.useGetFlowProps)();
|
|
37
|
+
const PropertyPopover = getProps().PropertyPopover;
|
|
38
38
|
const version = origin.versions?.[0];
|
|
39
39
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
40
40
|
className: (0, _classcat.default)([`${prefixCls}-service`, {
|
|
@@ -46,7 +46,7 @@ const ServiceGroup = exports.ServiceGroup = /*#__PURE__*/_react2.default.memo(pr
|
|
|
46
46
|
name,
|
|
47
47
|
count
|
|
48
48
|
} = origin;
|
|
49
|
-
const
|
|
49
|
+
const getProps = (0, _base.useGetFlowProps)();
|
|
50
50
|
const update = (0, _ahooks.useUpdate)();
|
|
51
51
|
const triggerLayout = (0, _base.useForceUpdate)();
|
|
52
52
|
const {
|
|
@@ -67,7 +67,7 @@ const ServiceGroup = exports.ServiceGroup = /*#__PURE__*/_react2.default.memo(pr
|
|
|
67
67
|
current,
|
|
68
68
|
pageSize
|
|
69
69
|
} = params;
|
|
70
|
-
const getChildren =
|
|
70
|
+
const getChildren = getProps().getChildren;
|
|
71
71
|
try {
|
|
72
72
|
const {
|
|
73
73
|
total,
|
|
@@ -152,7 +152,7 @@ const ServiceGroup = exports.ServiceGroup = /*#__PURE__*/_react2.default.memo(pr
|
|
|
152
152
|
size: 'small',
|
|
153
153
|
spinning: loading,
|
|
154
154
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
155
|
-
className: `${prefixCls}
|
|
155
|
+
className: `${prefixCls}-group_items`,
|
|
156
156
|
children: list?.map(node => {
|
|
157
157
|
const {
|
|
158
158
|
type,
|
|
@@ -18,7 +18,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
18
18
|
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
import { CollapseButton, HiddenHandle, useForceUpdate,
|
|
21
|
+
import { CollapseButton, HiddenHandle, useForceUpdate, useGetFlowProps } from "@rxflow/base";
|
|
22
22
|
import { Position } from "@xyflow/react";
|
|
23
23
|
import React, { useMemo } from "react";
|
|
24
24
|
import { useMemoizedFn, useUpdate } from "ahooks";
|
|
@@ -90,7 +90,7 @@ export var Connector = function Connector(_ref2) {
|
|
|
90
90
|
siblings = _ref2.siblings;
|
|
91
91
|
var update = useUpdate();
|
|
92
92
|
var triggerLayout = useForceUpdate();
|
|
93
|
-
var
|
|
93
|
+
var getProps = useGetFlowProps();
|
|
94
94
|
var config = version[direction];
|
|
95
95
|
var connectorState = useMemo(function () {
|
|
96
96
|
return getStateWithDefault(config);
|
|
@@ -117,10 +117,10 @@ export var Connector = function Connector(_ref2) {
|
|
|
117
117
|
config.state = 'expanded'; // 展开状态,关联的节点需要显示,在布局函数中处理
|
|
118
118
|
triggerLayout();
|
|
119
119
|
} else {
|
|
120
|
-
var
|
|
120
|
+
var _getProps$getRelation, _getProps;
|
|
121
121
|
config.state = 'loading';
|
|
122
122
|
update(); // 变成加载状态
|
|
123
|
-
(
|
|
123
|
+
(_getProps$getRelation = (_getProps = getProps()).getRelation) === null || _getProps$getRelation === void 0 || _getProps$getRelation.call(_getProps, direction, source, version).then(function (_ref3) {
|
|
124
124
|
var count = _ref3.count,
|
|
125
125
|
list = _ref3.list;
|
|
126
126
|
// 执行互斥逻辑,将同级所有节点展开项全部关闭
|
|
@@ -7,39 +7,23 @@
|
|
|
7
7
|
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
8
8
|
*/
|
|
9
9
|
import { IBaseFlowProps } from '@rxflow/base';
|
|
10
|
-
import {
|
|
11
|
-
type
|
|
10
|
+
import { GroupBloodlineExtendProps } from '../types';
|
|
11
|
+
type GroupBloodlineFullProps = IBaseFlowProps & GroupBloodlineExtendProps;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* 获取 Flow props
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
|
-
* const
|
|
17
|
-
* const root =
|
|
16
|
+
* const props = useGroupBloodlineProps();
|
|
17
|
+
* const root = useGroupBloodlineProps(state => state.root);
|
|
18
18
|
*/
|
|
19
|
-
export declare function
|
|
20
|
-
export declare function
|
|
19
|
+
export declare function useGroupBloodlineProps(): GroupBloodlineFullProps;
|
|
20
|
+
export declare function useGroupBloodlineProps<U>(selector: (state: GroupBloodlineFullProps) => U): U;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* const flowProps = useGroupBloodlineFlowProps();
|
|
26
|
-
* const nodes = useGroupBloodlineFlowProps(state => state.nodes);
|
|
27
|
-
*/
|
|
28
|
-
export declare function useGroupBloodlineFlowProps(): GroupBloodlineFullFlowProps;
|
|
29
|
-
export declare function useGroupBloodlineFlowProps<U>(selector: (state: GroupBloodlineFullFlowProps) => U): U;
|
|
30
|
-
/**
|
|
31
|
-
* 获取原始输入 props 的 getter(非响应式)
|
|
32
|
-
*/
|
|
33
|
-
export declare const useGetGroupBloodlineInputProps: () => {
|
|
34
|
-
(): IGroupBloodlineFlowProps;
|
|
35
|
-
<U>(selector: (state: IGroupBloodlineFlowProps) => U): U;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* 获取转换后 Flow props 的 getter(非响应式)
|
|
22
|
+
* 获取 Flow props 的 getter(非响应式)
|
|
39
23
|
*/
|
|
40
|
-
export declare const
|
|
41
|
-
():
|
|
42
|
-
<U>(selector: (state:
|
|
24
|
+
export declare const useGetGroupBloodlineProps: () => {
|
|
25
|
+
(): GroupBloodlineFullProps;
|
|
26
|
+
<U>(selector: (state: GroupBloodlineFullProps) => U): U;
|
|
43
27
|
};
|
|
44
28
|
/**
|
|
45
29
|
* 获取 root 节点数据
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGroupBloodlineProps.d.ts","sourceRoot":"","sources":["useGroupBloodlineProps.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"useGroupBloodlineProps.d.ts","sourceRoot":"","sources":["useGroupBloodlineProps.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;AACH,OAAO,EAAiC,cAAc,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAA4B,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAE/E,KAAK,uBAAuB,GAAG,cAAc,GAAG,yBAAyB,CAAC;AAE1E;;;;;;GAMG;AACH,wBAAgB,sBAAsB,IAAI,uBAAuB,CAAC;AAClE,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,CAAC,GAAG,CAAC,CAAC;AAK9F;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;CAErC,CAAC;AAGF;;GAEG;AACH,eAAO,MAAM,qBAAqB,iEAAoD,CAAC;AAEvF;;GAEG;AACH,eAAO,MAAM,mBAAmB,+MAA2D,CAAC;AAE5F;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;EAA2D,CAAC;AAE5F;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;EAA+D,CAAC"}
|
|
@@ -5,43 +5,24 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { useFlowProps, useGetFlowProps } from '@rxflow/base';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* 获取 Flow props
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
|
-
* const
|
|
15
|
-
* const root =
|
|
14
|
+
* const props = useGroupBloodlineProps();
|
|
15
|
+
* const root = useGroupBloodlineProps(state => state.root);
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
export function
|
|
19
|
-
return useInputProps(selector);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* 获取转换后的 Flow props
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* const flowProps = useGroupBloodlineFlowProps();
|
|
27
|
-
* const nodes = useGroupBloodlineFlowProps(state => state.nodes);
|
|
28
|
-
*/
|
|
29
|
-
|
|
30
|
-
export function useGroupBloodlineFlowProps(selector) {
|
|
18
|
+
export function useGroupBloodlineProps(selector) {
|
|
31
19
|
return useFlowProps(selector);
|
|
32
20
|
}
|
|
33
21
|
|
|
34
22
|
/**
|
|
35
|
-
*
|
|
36
|
-
*/
|
|
37
|
-
export var useGetGroupBloodlineInputProps = function useGetGroupBloodlineInputProps() {
|
|
38
|
-
return useGetInputProps();
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* 获取转换后 Flow props 的 getter(非响应式)
|
|
23
|
+
* 获取 Flow props 的 getter(非响应式)
|
|
43
24
|
*/
|
|
44
|
-
export var
|
|
25
|
+
export var useGetGroupBloodlineProps = function useGetGroupBloodlineProps() {
|
|
45
26
|
return useGetFlowProps();
|
|
46
27
|
};
|
|
47
28
|
|
|
@@ -50,7 +31,7 @@ export var useGetGroupBloodlineFlowProps = function useGetGroupBloodlineFlowProp
|
|
|
50
31
|
* 获取 root 节点数据
|
|
51
32
|
*/
|
|
52
33
|
export var useGroupBloodlineRoot = function useGroupBloodlineRoot() {
|
|
53
|
-
return
|
|
34
|
+
return useGroupBloodlineProps(function (state) {
|
|
54
35
|
return state.root;
|
|
55
36
|
});
|
|
56
37
|
};
|
|
@@ -59,7 +40,7 @@ export var useGroupBloodlineRoot = function useGroupBloodlineRoot() {
|
|
|
59
40
|
* 获取异步加载关联节点的函数
|
|
60
41
|
*/
|
|
61
42
|
export var useGroupGetRelation = function useGroupGetRelation() {
|
|
62
|
-
return
|
|
43
|
+
return useGroupBloodlineProps(function (state) {
|
|
63
44
|
return state.getRelation;
|
|
64
45
|
});
|
|
65
46
|
};
|
|
@@ -68,7 +49,7 @@ export var useGroupGetRelation = function useGroupGetRelation() {
|
|
|
68
49
|
* 获取异步加载子节点的函数
|
|
69
50
|
*/
|
|
70
51
|
export var useGroupGetChildren = function useGroupGetChildren() {
|
|
71
|
-
return
|
|
52
|
+
return useGroupBloodlineProps(function (state) {
|
|
72
53
|
return state.getChildren;
|
|
73
54
|
});
|
|
74
55
|
};
|
|
@@ -77,7 +58,7 @@ export var useGroupGetChildren = function useGroupGetChildren() {
|
|
|
77
58
|
* 获取属性弹窗组件
|
|
78
59
|
*/
|
|
79
60
|
export var usePropertyPopover = function usePropertyPopover() {
|
|
80
|
-
return
|
|
61
|
+
return useGroupBloodlineProps(function (state) {
|
|
81
62
|
return state.PropertyPopover;
|
|
82
63
|
});
|
|
83
64
|
};
|
package/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAGnD,OAAO,EAA6B,wBAAwB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,iBAAiB,EAAW,MAAM,OAAO,CAAC;AAGnD,OAAO,EAA6B,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAuC9E,QAAA,MAAM,kBAAkB,iGAGvB,CAAC;AAEF,eAAe,kBAAkB,CAAC;AAGlC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAG5B,cAAc,gCAAgC,CAAC"}
|
package/esm/index.js
CHANGED
|
@@ -28,8 +28,7 @@ var defaultFitViewOptions = {
|
|
|
28
28
|
*/
|
|
29
29
|
var useGroupBloodlinePropsTransform = function useGroupBloodlinePropsTransform(props) {
|
|
30
30
|
var root = props.root,
|
|
31
|
-
userFitViewOptions = props.fitViewOptions
|
|
32
|
-
userFlowProps = props.flowProps;
|
|
31
|
+
userFitViewOptions = props.fitViewOptions;
|
|
33
32
|
|
|
34
33
|
// 将 root 转换为 nodes(放在外层)
|
|
35
34
|
var nodes = useMemo(function () {
|
|
@@ -40,13 +39,6 @@ var useGroupBloodlinePropsTransform = function useGroupBloodlinePropsTransform(p
|
|
|
40
39
|
var fitViewOptions = useMemo(function () {
|
|
41
40
|
return _objectSpread(_objectSpread({}, defaultFitViewOptions), userFitViewOptions);
|
|
42
41
|
}, [userFitViewOptions]);
|
|
43
|
-
|
|
44
|
-
// 合并 flowProps(不常用的配置)
|
|
45
|
-
var flowProps = useMemo(function () {
|
|
46
|
-
return _objectSpread({
|
|
47
|
-
edgesFocusable: false
|
|
48
|
-
}, userFlowProps);
|
|
49
|
-
}, [userFlowProps]);
|
|
50
42
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
51
43
|
nodes: nodes,
|
|
52
44
|
nodeTypes: nodeTypes,
|
|
@@ -57,8 +49,8 @@ var useGroupBloodlinePropsTransform = function useGroupBloodlinePropsTransform(p
|
|
|
57
49
|
selectionOnDrag: false,
|
|
58
50
|
minZoom: 1,
|
|
59
51
|
maxZoom: 1,
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
edgesFocusable: false,
|
|
53
|
+
fitViewOptions: fitViewOptions
|
|
62
54
|
});
|
|
63
55
|
};
|
|
64
56
|
var GroupBloodlineFlow = createFlow(Flow, useGroupBloodlinePropsTransform);
|
|
@@ -19,7 +19,7 @@ import "./index.less";
|
|
|
19
19
|
import { memo } from "react";
|
|
20
20
|
import { get, isEqual, set } from 'lodash';
|
|
21
21
|
import { BloodlineDirection, BloodlineNodeType, groupPageSize } from "../..";
|
|
22
|
-
import { LoadingButton,
|
|
22
|
+
import { LoadingButton, useGetFlowProps, useForceUpdate } from "@rxflow/base";
|
|
23
23
|
import { useDebounceFn, useMemoizedFn } from "ahooks";
|
|
24
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
25
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -47,7 +47,7 @@ var ToolbarNode = /*#__PURE__*/memo(function (props) {
|
|
|
47
47
|
_ref$siblings = _ref.siblings,
|
|
48
48
|
siblings = _ref$siblings === void 0 ? [] : _ref$siblings;
|
|
49
49
|
var triggerLayout = useForceUpdate();
|
|
50
|
-
var
|
|
50
|
+
var getProps = useGetFlowProps();
|
|
51
51
|
var _useDebounceFn = useDebounceFn(function () {
|
|
52
52
|
triggerLayout();
|
|
53
53
|
}, {
|
|
@@ -87,7 +87,7 @@ var ToolbarNode = /*#__PURE__*/memo(function (props) {
|
|
|
87
87
|
while (1) switch (_context.prev = _context.next) {
|
|
88
88
|
case 0:
|
|
89
89
|
_context.prev = 0;
|
|
90
|
-
getChildren =
|
|
90
|
+
getChildren = getProps().getChildren;
|
|
91
91
|
_context.next = 4;
|
|
92
92
|
return getChildren === null || getChildren === void 0 ? void 0 : getChildren(sibling, groupPageSize, 1, direction);
|
|
93
93
|
case 4:
|
|
@@ -11,7 +11,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
11
11
|
*
|
|
12
12
|
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
13
13
|
*/
|
|
14
|
-
import { Popover,
|
|
14
|
+
import { Popover, useGetFlowProps } from "@rxflow/base";
|
|
15
15
|
import { BloodlineDirection } from "../..";
|
|
16
16
|
import "../../style/index.less";
|
|
17
17
|
import cat from 'classcat';
|
|
@@ -29,8 +29,8 @@ export var MultipleVersionRender = function MultipleVersionRender(props) {
|
|
|
29
29
|
var name = origin.name,
|
|
30
30
|
versions = origin.versions,
|
|
31
31
|
hit = origin.hit;
|
|
32
|
-
var
|
|
33
|
-
var PropertyPopover =
|
|
32
|
+
var getProps = useGetFlowProps();
|
|
33
|
+
var PropertyPopover = getProps().PropertyPopover;
|
|
34
34
|
return /*#__PURE__*/_jsxs("div", {
|
|
35
35
|
className: cat(["".concat(prefixCls, "-service"), _defineProperty({}, "".concat(prefixCls, "-hit"), hit)]),
|
|
36
36
|
children: [/*#__PURE__*/_jsx("div", {
|
|
@@ -12,7 +12,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
12
12
|
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
13
13
|
*/
|
|
14
14
|
import React from "react";
|
|
15
|
-
import { Popover,
|
|
15
|
+
import { Popover, useGetFlowProps } from '@rxflow/base';
|
|
16
16
|
import "../../style/index.less";
|
|
17
17
|
import { Version } from "../../components/Version";
|
|
18
18
|
import { Connector } from "../../components/Connector";
|
|
@@ -29,8 +29,8 @@ export var SingleVersionNodeRender = function SingleVersionNodeRender(props) {
|
|
|
29
29
|
depth = props.depth;
|
|
30
30
|
var name = origin.name,
|
|
31
31
|
hit = origin.hit;
|
|
32
|
-
var
|
|
33
|
-
var PropertyPopover =
|
|
32
|
+
var getProps = useGetFlowProps();
|
|
33
|
+
var PropertyPopover = getProps().PropertyPopover;
|
|
34
34
|
var version = (_origin$versions = origin.versions) === null || _origin$versions === void 0 ? void 0 : _origin$versions[0];
|
|
35
35
|
return /*#__PURE__*/_jsxs("div", {
|
|
36
36
|
className: cat(["".concat(prefixCls, "-service"), _defineProperty({}, "".concat(prefixCls, "-hit"), hit)]),
|
|
@@ -13,7 +13,7 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
13
13
|
* Copyright (c) 2025 by yanxianliang, All Rights Reserved.
|
|
14
14
|
*/
|
|
15
15
|
import ArrowsAltOutlined from "@ant-design/icons/ArrowsAltOutlined";
|
|
16
|
-
import { HiddenHandle, Tooltip, useForceUpdate,
|
|
16
|
+
import { HiddenHandle, Tooltip, useForceUpdate, useGetFlowProps } from "@rxflow/base";
|
|
17
17
|
import "../../style/index.less";
|
|
18
18
|
import { Position, useUpdateNodeInternals } from "@xyflow/react";
|
|
19
19
|
import { useMemoizedFn, useRequest, useUpdate } from "ahooks";
|
|
@@ -39,7 +39,7 @@ export var ServiceGroup = /*#__PURE__*/React.memo(function (props) {
|
|
|
39
39
|
depth = data.depth;
|
|
40
40
|
var name = origin.name,
|
|
41
41
|
count = origin.count;
|
|
42
|
-
var
|
|
42
|
+
var getProps = useGetFlowProps();
|
|
43
43
|
var update = useUpdate();
|
|
44
44
|
var triggerLayout = useForceUpdate();
|
|
45
45
|
var _ref = origin.state || {},
|
|
@@ -64,7 +64,7 @@ export var ServiceGroup = /*#__PURE__*/React.memo(function (props) {
|
|
|
64
64
|
set(origin, ['state', 'loading'], true);
|
|
65
65
|
update();
|
|
66
66
|
current = params.current, pageSize = params.pageSize;
|
|
67
|
-
getChildren =
|
|
67
|
+
getChildren = getProps().getChildren;
|
|
68
68
|
_context.prev = 4;
|
|
69
69
|
_context.next = 7;
|
|
70
70
|
return getChildren === null || getChildren === void 0 ? void 0 : getChildren(origin, pageSize, current, direction);
|
|
@@ -163,7 +163,7 @@ export var ServiceGroup = /*#__PURE__*/React.memo(function (props) {
|
|
|
163
163
|
size: 'small',
|
|
164
164
|
spinning: loading,
|
|
165
165
|
children: /*#__PURE__*/_jsx("div", {
|
|
166
|
-
className: "".concat(prefixCls, "
|
|
166
|
+
className: "".concat(prefixCls, "-group_items"),
|
|
167
167
|
children: list === null || list === void 0 ? void 0 : list.map(function (node) {
|
|
168
168
|
var type = node.type,
|
|
169
169
|
id = node.id;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxflow/group-bloodline",
|
|
3
|
-
"version": "0.0.4-alpha.
|
|
3
|
+
"version": "0.0.4-alpha.7",
|
|
4
4
|
"description": "分组血缘关系图",
|
|
5
5
|
"homepage": "https://tree-graph.publib.cn/packages/group-bloodline",
|
|
6
6
|
"repository": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"build": "father build"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@rxflow/base": "^0.0.4-alpha.
|
|
34
|
+
"@rxflow/base": "^0.0.4-alpha.7"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@ant-design/icons": ">=6.0.0",
|