react-kggraph 0.0.8 → 0.0.10
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/lib/index.es.js +8 -4
- package/lib/index.es10.js +188 -0
- package/lib/index.es11.js +72 -0
- package/lib/index.es12.js +32 -0
- package/lib/index.es13.js +72 -0
- package/lib/index.es14.js +226 -0
- package/lib/index.es15.js +6 -0
- package/lib/index.es16.js +38 -0
- package/lib/index.es18.js +15469 -0
- package/lib/index.es19.js +56 -0
- package/lib/index.es20.js +62 -0
- package/lib/index.es21.js +71 -0
- package/lib/index.es22.js +42 -0
- package/lib/index.es23.js +4 -0
- package/lib/index.es24.js +4 -0
- package/lib/index.es25.js +4 -0
- package/lib/index.es26.js +4 -0
- package/lib/index.es27.js +4 -0
- package/lib/index.es28.js +4 -0
- package/lib/index.es29.js +4 -0
- package/lib/index.es3.js +356 -0
- package/lib/index.es30.js +4 -0
- package/lib/index.es31.js +4 -0
- package/lib/index.es32.js +4 -0
- package/lib/index.es33.js +4 -0
- package/lib/index.es35.js +6 -0
- package/lib/index.es36.js +4 -0
- package/lib/index.es4.js +8 -0
- package/lib/index.es5.js +4 -0
- package/lib/index.es6.js +601 -0
- package/lib/index.es7.js +7 -0
- package/lib/index.es8.js +324 -0
- package/lib/index.es9.js +423 -0
- package/lib/style.css +1 -0
- package/package.json +2 -3
- package/lib/index10.es.js +0 -4
- package/lib/index11.es.js +0 -4
- package/lib/index12.es.js +0 -4
- package/lib/index13.es.js +0 -4
- package/lib/index14.es.js +0 -4
- package/lib/index15.es.js +0 -4
- package/lib/index16.es.js +0 -4
- package/lib/index17.es.js +0 -25
- package/lib/index18.es.js +0 -330
- package/lib/index19.es.js +0 -5
- package/lib/index2.es.js +0 -13
- package/lib/index20.es.js +0 -284
- package/lib/index22.es.js +0 -70
- package/lib/index24.es.js +0 -68
- package/lib/index26.es.js +0 -72
- package/lib/index27.es.js +0 -32
- package/lib/index28.es.js +0 -828
- package/lib/index29.es.js +0 -4
- package/lib/index30.es.js +0 -161
- package/lib/index31.es.js +0 -71
- package/lib/index33.es.js +0 -100
- package/lib/index34.es.js +0 -250
- package/lib/index35.es.js +0 -47
- package/lib/index36.es.js +0 -376
- package/lib/index37.es.js +0 -12
- package/lib/index38.es.js +0 -6
- package/lib/index5.es.js +0 -12387
- package/lib/index6.es.js +0 -4
- package/lib/index7.es.js +0 -4
- package/lib/index8.es.js +0 -4
- package/lib/index9.es.js +0 -4
- package/lib/react-kggraph.css +0 -2
package/lib/index.es.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/* empty css */
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { SearchType as
|
|
5
|
-
export {
|
|
2
|
+
import { default as t } from "./index.es3.js";
|
|
3
|
+
import { default as p } from "./index.es4.js";
|
|
4
|
+
import { SearchType as m } from "./index.es5.js";
|
|
5
|
+
export {
|
|
6
|
+
t as CytoscapeReact,
|
|
7
|
+
p as Demo,
|
|
8
|
+
m as SearchType
|
|
9
|
+
};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
const i = [
|
|
2
|
+
{
|
|
3
|
+
selector: "node",
|
|
4
|
+
style: {
|
|
5
|
+
"text-margin-y": "5px"
|
|
6
|
+
}
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
selector: "edge",
|
|
10
|
+
style: {
|
|
11
|
+
// 核心:默认链接线颜色(和 hover 区分开)
|
|
12
|
+
"line-color": "#a29e9e",
|
|
13
|
+
// 核心:默认箭头颜色(和 hover 区分开)
|
|
14
|
+
"target-arrow-color": "#a29e9e",
|
|
15
|
+
// 核心:默认透明度(和 hover 区分开)
|
|
16
|
+
opacity: 1,
|
|
17
|
+
// 箭头形状(必须配置才会显示箭头)
|
|
18
|
+
"target-arrow-shape": "triangle",
|
|
19
|
+
// 链接线宽度
|
|
20
|
+
width: 2,
|
|
21
|
+
// 曲线样式
|
|
22
|
+
"curve-style": "bezier",
|
|
23
|
+
// 可选:过渡动画(颜色变化更丝滑)
|
|
24
|
+
"transition-property": "line-color, target-arrow-color, opacity",
|
|
25
|
+
"transition-duration": "0.2s",
|
|
26
|
+
label: "data(name)",
|
|
27
|
+
"z-index": 9999,
|
|
28
|
+
// 连线文字设置
|
|
29
|
+
"text-opacity": 1,
|
|
30
|
+
"font-size": 18,
|
|
31
|
+
color: "#666",
|
|
32
|
+
"text-background-color": "#fff",
|
|
33
|
+
"text-background-opacity": 1,
|
|
34
|
+
"text-background-shape": "roundrectangle",
|
|
35
|
+
// 'text-border-width': 2,
|
|
36
|
+
// 'text-border-opacity':1,
|
|
37
|
+
// 'text-border-color': '#e9e7e7',
|
|
38
|
+
"text-background-padding": "3px"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
selector: ".highlight",
|
|
43
|
+
style: {
|
|
44
|
+
"border-color": "rgba(174, 255, 45, 0.2)",
|
|
45
|
+
"border-width": 4
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
selector: ".path-node",
|
|
50
|
+
style: {
|
|
51
|
+
"background-color": "#145AFD",
|
|
52
|
+
"border-color": "#FFEB3B"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
selector: ".path-edge",
|
|
57
|
+
style: {
|
|
58
|
+
"line-color": "#145AFD",
|
|
59
|
+
"target-arrow-color": "#145AFD",
|
|
60
|
+
width: 4
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
selector: ".grayed",
|
|
65
|
+
style: {
|
|
66
|
+
opacity: 0.15,
|
|
67
|
+
"text-opacity": 0.15
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
selector: "node.selected, edge.selected",
|
|
72
|
+
// 选中状态的样式
|
|
73
|
+
style: {
|
|
74
|
+
// 'line-color': 'rgba(66, 133, 244, 0.5)', // 选中边的颜色
|
|
75
|
+
"border-color": "rgba(174, 255, 45, 0.2)",
|
|
76
|
+
"border-width": 4
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
selector: ".correlationStyle",
|
|
81
|
+
style: {
|
|
82
|
+
width: 60,
|
|
83
|
+
height: 60,
|
|
84
|
+
// 'background-color': '#fff',
|
|
85
|
+
// 核心:outline(外边框)+ blur滤镜实现发光
|
|
86
|
+
"outline-width": "10px",
|
|
87
|
+
"outline-color": "rgba(188, 220, 255, 0.4)",
|
|
88
|
+
"outline-style": "solid",
|
|
89
|
+
"line-opacity": "0.2",
|
|
90
|
+
"outline-offset": "2px",
|
|
91
|
+
// 偏移避免遮挡节点
|
|
92
|
+
filter: "blur(20px)",
|
|
93
|
+
// 模糊outline,模拟发光
|
|
94
|
+
"z-index": 9999
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
selector: ".hover",
|
|
99
|
+
style: {
|
|
100
|
+
"border-width": 3,
|
|
101
|
+
"border-color": "#0d6ac2"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
// 层级分析样式 - 目标节点
|
|
105
|
+
{
|
|
106
|
+
selector: ".level-selected",
|
|
107
|
+
style: {
|
|
108
|
+
"background-color": "#f8bbd0",
|
|
109
|
+
"border-color": "#e91e63",
|
|
110
|
+
"border-width": 4,
|
|
111
|
+
color: "#880e4f"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
// 层级分析样式 - 关联节点
|
|
115
|
+
{
|
|
116
|
+
selector: ".level-highlight",
|
|
117
|
+
style: {
|
|
118
|
+
"background-color": "#bbdefb",
|
|
119
|
+
"border-color": "#2196f3",
|
|
120
|
+
"border-width": 3,
|
|
121
|
+
color: "#0d47a1"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
// 层级分析样式 - 边高亮
|
|
125
|
+
{
|
|
126
|
+
selector: ".level-highlightedge",
|
|
127
|
+
style: {
|
|
128
|
+
"line-color": "#1976d2",
|
|
129
|
+
"target-arrow-color": "#1976d2",
|
|
130
|
+
width: 3,
|
|
131
|
+
opacity: 1
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
// 层级分析样式 - 置灰
|
|
135
|
+
{
|
|
136
|
+
selector: ".level-grayed",
|
|
137
|
+
style: {
|
|
138
|
+
opacity: 0.15,
|
|
139
|
+
"text-opacity": 0.15
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
], n = ({ elements: c }) => {
|
|
143
|
+
const o = [];
|
|
144
|
+
c.map((e) => {
|
|
145
|
+
var r, l, a;
|
|
146
|
+
!o.includes((r = e == null ? void 0 : e.data) == null ? void 0 : r.type) && ((l = e == null ? void 0 : e.data) != null && l.type) && o.push((a = e.data) == null ? void 0 : a.type);
|
|
147
|
+
});
|
|
148
|
+
const t = [];
|
|
149
|
+
return t.push({
|
|
150
|
+
selector: '[properties-type="uri"]',
|
|
151
|
+
style: {
|
|
152
|
+
"background-color": "#f7de63",
|
|
153
|
+
// 黄色
|
|
154
|
+
"background-image": "data(image)",
|
|
155
|
+
// 'background-image': sticon1,
|
|
156
|
+
"background-fit": "cover",
|
|
157
|
+
width: 80,
|
|
158
|
+
height: 80,
|
|
159
|
+
label: "data(name)",
|
|
160
|
+
color: "black",
|
|
161
|
+
"text-valign": "bottom",
|
|
162
|
+
"font-size": 18,
|
|
163
|
+
"text-max-width": "250px",
|
|
164
|
+
"text-wrap": "ellipsis",
|
|
165
|
+
"text-overflow-wrap": "anywhere"
|
|
166
|
+
}
|
|
167
|
+
}), t.push({
|
|
168
|
+
selector: '[properties-type!="uri"]',
|
|
169
|
+
style: {
|
|
170
|
+
"background-color": "#1890FF",
|
|
171
|
+
// 蓝色
|
|
172
|
+
"background-image": "data(image)",
|
|
173
|
+
"background-fit": "cover",
|
|
174
|
+
width: 80,
|
|
175
|
+
height: 80,
|
|
176
|
+
label: "data(name)",
|
|
177
|
+
color: "black",
|
|
178
|
+
"text-valign": "bottom",
|
|
179
|
+
"font-size": 18,
|
|
180
|
+
"text-max-width": "250px",
|
|
181
|
+
"text-wrap": "ellipsis",
|
|
182
|
+
"text-overflow-wrap": "anywhere"
|
|
183
|
+
}
|
|
184
|
+
}), t.concat(i);
|
|
185
|
+
};
|
|
186
|
+
export {
|
|
187
|
+
n as edgeNodeStyles
|
|
188
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
const i = ({ cyRef: n, setContextMenu: t, onPathAnalysis: l, setPathNodes: a }) => [
|
|
2
|
+
{
|
|
3
|
+
label: "展收实体",
|
|
4
|
+
ids: "contract",
|
|
5
|
+
action: (e) => {
|
|
6
|
+
const o = n.current;
|
|
7
|
+
console.log("新增属性", o);
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
label: "展收属性",
|
|
12
|
+
ids: "expanded",
|
|
13
|
+
action: (e) => {
|
|
14
|
+
if (console.log("展开", e), !n.current) {
|
|
15
|
+
console.error("Cytoscape instance is not available");
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
console.log("New node and edge added");
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: "节点信息",
|
|
23
|
+
ids: "nodeInfo",
|
|
24
|
+
action: (e) => {
|
|
25
|
+
console.log("节点信息:", e);
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: "知识卡片",
|
|
30
|
+
ids: "knowledgeCard",
|
|
31
|
+
action: (e) => {
|
|
32
|
+
const o = n.current;
|
|
33
|
+
console.log("知识卡片", o);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
// {
|
|
37
|
+
// label: '新增关系',
|
|
38
|
+
// action: (node) => {
|
|
39
|
+
// const cy = cyRef.current;
|
|
40
|
+
// console.log('新增关系', cy)
|
|
41
|
+
// },
|
|
42
|
+
// },
|
|
43
|
+
{
|
|
44
|
+
label: "选中关联",
|
|
45
|
+
ids: "selRelate",
|
|
46
|
+
action: (e) => {
|
|
47
|
+
const o = n.current;
|
|
48
|
+
if (!o || !e || e.removed()) {
|
|
49
|
+
console.error("节点或Cytoscape实例无效"), t((r) => ({ ...r, visible: !1 }));
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const s = e, c = s.neighborhood().nodes().add(s);
|
|
53
|
+
c.edgesWith(c), o.nodes().not(c).removeClass("correlationStyle"), c.addClass("correlationStyle"), t((r) => ({ ...r, visible: !1 }));
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: "路径分析",
|
|
58
|
+
action: (e) => {
|
|
59
|
+
n.current, console.log(11, e.data("name")), l == null || l(), a([e.data("name"), ""]);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: "删除节点",
|
|
64
|
+
action: (e) => {
|
|
65
|
+
const o = n.current;
|
|
66
|
+
console.log("删除节点cy::::", o), e && !e.removed() && e.remove();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
];
|
|
70
|
+
export {
|
|
71
|
+
i as menuItemsConfig
|
|
72
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const t = (r) => {
|
|
2
|
+
if (n(r) || Array.isArray(r))
|
|
3
|
+
try {
|
|
4
|
+
return JSON.stringify(r);
|
|
5
|
+
} catch (e) {
|
|
6
|
+
console.log("JSON.stringify", e);
|
|
7
|
+
}
|
|
8
|
+
else
|
|
9
|
+
return r;
|
|
10
|
+
}, c = (r) => {
|
|
11
|
+
if (n(r) || Array.isArray(r))
|
|
12
|
+
try {
|
|
13
|
+
return JSON.parse(JSON.stringify(r));
|
|
14
|
+
} catch (e) {
|
|
15
|
+
console.log("JSON.stringify-JSON.parse", e);
|
|
16
|
+
}
|
|
17
|
+
else
|
|
18
|
+
return r;
|
|
19
|
+
};
|
|
20
|
+
function n(r) {
|
|
21
|
+
return r !== null && typeof r == "object" && !Array.isArray(r);
|
|
22
|
+
}
|
|
23
|
+
const i = (r, e) => {
|
|
24
|
+
const o = document.createElement("a");
|
|
25
|
+
o.href = r, o.download = e, document.body.appendChild(o), o.click(), document.body.removeChild(o);
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
i as downloadFile,
|
|
29
|
+
n as isObject,
|
|
30
|
+
t as jsonStringify,
|
|
31
|
+
c as jsonStringifyParse
|
|
32
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as b } from "react";
|
|
3
|
+
/* empty css */
|
|
4
|
+
const L = ({
|
|
5
|
+
items: h = [
|
|
6
|
+
// { label: '知识卡片' },
|
|
7
|
+
// { label: '选中关联' },
|
|
8
|
+
// { label: '路径分析' },
|
|
9
|
+
// { label: '展收实体' },
|
|
10
|
+
// { label: '展收属性' },
|
|
11
|
+
// { label: '节点配置' },
|
|
12
|
+
],
|
|
13
|
+
centerImage: f,
|
|
14
|
+
size: c = 200,
|
|
15
|
+
onClick: $
|
|
16
|
+
}) => {
|
|
17
|
+
const t = c / 2, a = c / 2 - 10, s = 30, o = 360 / h.length, p = b(() => h.map((n, r) => {
|
|
18
|
+
const l = (r * o - 90) * (Math.PI / 180), i = ((r + 1) * o - 90) * (Math.PI / 180), m = ((r + 0.5) * o - 90) * (Math.PI / 180), y = t + a * Math.cos(l), v = t + a * Math.sin(l), w = t + a * Math.cos(i), A = t + a * Math.sin(i), N = t + s * Math.cos(i), k = t + s * Math.sin(i), u = t + s * Math.cos(l), x = t + s * Math.sin(l), g = o > 180 ? 1 : 0, I = `M ${u} ${x} L ${y} ${v} A ${a} ${a} 0 ${g} 1 ${w} ${A} L ${N} ${k} A ${s} ${s} 0 ${g} 0 ${u} ${x}`, M = (a + s) / 2 + 5, P = t + M * Math.cos(m), R = t + M * Math.sin(m);
|
|
19
|
+
return {
|
|
20
|
+
...n,
|
|
21
|
+
path: I,
|
|
22
|
+
textX: P,
|
|
23
|
+
textY: R,
|
|
24
|
+
rotation: (r + 0.5) * o - 90
|
|
25
|
+
};
|
|
26
|
+
}), [h, o, t, a, s]);
|
|
27
|
+
return /* @__PURE__ */ d("div", { className: "radial-menu", style: { width: c, height: c }, children: [
|
|
28
|
+
/* @__PURE__ */ d("svg", { width: c, height: c, className: "radial-svg", children: [
|
|
29
|
+
/* @__PURE__ */ e("defs", { children: /* @__PURE__ */ e("filter", { id: "shadow", x: "-20%", y: "-20%", width: "140%", height: "140%", children: /* @__PURE__ */ e("feDropShadow", { dx: "0", dy: "2", stdDeviation: "3", floodOpacity: "0.3" }) }) }),
|
|
30
|
+
/* @__PURE__ */ e("circle", { cx: t, cy: t, r: a, fill: "#f5f5f5", stroke: "#ddd", strokeWidth: "1" }),
|
|
31
|
+
p.map((n, r) => /* @__PURE__ */ d("g", { onClick: () => $(n), className: "sector-group", children: [
|
|
32
|
+
/* @__PURE__ */ e(
|
|
33
|
+
"path",
|
|
34
|
+
{
|
|
35
|
+
d: n.path,
|
|
36
|
+
fill: "#333",
|
|
37
|
+
stroke: "rgb(185, 185, 185)",
|
|
38
|
+
strokeWidth: "1",
|
|
39
|
+
filter: "url(#shadow)",
|
|
40
|
+
className: "sector-path"
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ e(
|
|
44
|
+
"text",
|
|
45
|
+
{
|
|
46
|
+
x: n.textX,
|
|
47
|
+
y: n.textY,
|
|
48
|
+
textAnchor: "middle",
|
|
49
|
+
dominantBaseline: "middle",
|
|
50
|
+
fill: "#fff",
|
|
51
|
+
fontSize: "12",
|
|
52
|
+
fontWeight: "500",
|
|
53
|
+
className: "sector-label",
|
|
54
|
+
children: n.label
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
] }, r)),
|
|
58
|
+
/* @__PURE__ */ e("circle", { cx: t, cy: t, r: s + 2, fill: "#fff" })
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ e(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
className: "center-avatar",
|
|
64
|
+
style: { width: s * 2, height: s * 2 },
|
|
65
|
+
children: f ? /* @__PURE__ */ e("img", { src: f, alt: "avatar" }) : /* @__PURE__ */ e("span", { className: "center-text", children: "菜单" })
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
] });
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
L as default
|
|
72
|
+
};
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as h, useState as s, useImperativeHandle as b } from "react";
|
|
3
|
+
import { Drawer as x } from "antd";
|
|
4
|
+
const N = h((y, d) => {
|
|
5
|
+
const [c, t] = s(!1), [a, o] = s({ style: {}, data: {} });
|
|
6
|
+
b(d, () => ({
|
|
7
|
+
open: (n) => {
|
|
8
|
+
t(!0), o(n);
|
|
9
|
+
},
|
|
10
|
+
close: () => t(!1)
|
|
11
|
+
}));
|
|
12
|
+
const i = () => {
|
|
13
|
+
t(!1);
|
|
14
|
+
}, l = (n) => {
|
|
15
|
+
const { name: p, value: m } = n.target;
|
|
16
|
+
o((u) => ({ ...u, [p]: m }));
|
|
17
|
+
};
|
|
18
|
+
return /* @__PURE__ */ e(
|
|
19
|
+
x,
|
|
20
|
+
{
|
|
21
|
+
title: "节点配置",
|
|
22
|
+
closable: { "aria-label": "Close Button" },
|
|
23
|
+
onClose: i,
|
|
24
|
+
open: c,
|
|
25
|
+
getContainer: !1,
|
|
26
|
+
children: /* @__PURE__ */ e("div", { className: "h-full overflow-y-auto z-50", children: /* @__PURE__ */ r("div", { className: "space-y-4", children: [
|
|
27
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-4 !mb-20px", children: [
|
|
28
|
+
/* @__PURE__ */ e("label", { className: "w-40", children: "名称" }),
|
|
29
|
+
/* @__PURE__ */ e(
|
|
30
|
+
"input",
|
|
31
|
+
{
|
|
32
|
+
name: "name",
|
|
33
|
+
value: a.data.name,
|
|
34
|
+
onChange: l,
|
|
35
|
+
readOnly: !0,
|
|
36
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded focus:outline-none focus:ring-1 focus:ring-blue-500"
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
] }),
|
|
40
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-4 !mb-20px", children: [
|
|
41
|
+
/* @__PURE__ */ e("label", { className: "w-40", children: "类型" }),
|
|
42
|
+
/* @__PURE__ */ r(
|
|
43
|
+
"select",
|
|
44
|
+
{
|
|
45
|
+
name: "type",
|
|
46
|
+
value: a.type,
|
|
47
|
+
disabled: !0,
|
|
48
|
+
onChange: l,
|
|
49
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded bg-white",
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ e("option", { value: "圆形", children: "圆形" }),
|
|
52
|
+
/* @__PURE__ */ e("option", { value: "矩形", children: "矩形" })
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] }),
|
|
57
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-4 !mb-20px", children: [
|
|
58
|
+
/* @__PURE__ */ e("label", { className: "w-40", children: "颜色" }),
|
|
59
|
+
/* @__PURE__ */ r("div", { className: "flex-1 flex gap-2 items-center", children: [
|
|
60
|
+
/* @__PURE__ */ e(
|
|
61
|
+
"input",
|
|
62
|
+
{
|
|
63
|
+
name: "color",
|
|
64
|
+
readOnly: !0,
|
|
65
|
+
value: a.style.color,
|
|
66
|
+
onChange: l,
|
|
67
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded h-30px"
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ e(
|
|
71
|
+
"input",
|
|
72
|
+
{
|
|
73
|
+
type: "color",
|
|
74
|
+
readOnly: !0,
|
|
75
|
+
value: a.style.color,
|
|
76
|
+
onChange: (n) => o({ ...a, color: n.target.value }),
|
|
77
|
+
className: "h-20px w-20px rounded cursor-pointer border"
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
] })
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-4 !mb-20px", children: [
|
|
83
|
+
/* @__PURE__ */ e("label", { className: "w-40", children: "大小" }),
|
|
84
|
+
/* @__PURE__ */ e(
|
|
85
|
+
"input",
|
|
86
|
+
{
|
|
87
|
+
type: "number",
|
|
88
|
+
name: "size",
|
|
89
|
+
readOnly: !0,
|
|
90
|
+
value: parseInt(a.style.height),
|
|
91
|
+
onChange: l,
|
|
92
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded "
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
] }),
|
|
96
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-4 !mb-20px", children: [
|
|
97
|
+
/* @__PURE__ */ e("label", { className: "w-40", children: "边框宽度" }),
|
|
98
|
+
/* @__PURE__ */ e(
|
|
99
|
+
"input",
|
|
100
|
+
{
|
|
101
|
+
type: "number",
|
|
102
|
+
name: "borderWidth",
|
|
103
|
+
readOnly: !0,
|
|
104
|
+
value: parseInt(a.style.borderWidth),
|
|
105
|
+
onChange: l,
|
|
106
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded "
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
] }),
|
|
110
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-4 !mb-20px", children: [
|
|
111
|
+
/* @__PURE__ */ e("label", { className: "w-40", children: "边框虚线" }),
|
|
112
|
+
/* @__PURE__ */ r(
|
|
113
|
+
"select",
|
|
114
|
+
{
|
|
115
|
+
name: "borderDash",
|
|
116
|
+
value: a.style.borderDash,
|
|
117
|
+
disabled: !0,
|
|
118
|
+
onChange: l,
|
|
119
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded bg-white",
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ e("option", { value: "否", children: "否" }),
|
|
122
|
+
/* @__PURE__ */ e("option", { value: "是", children: "是" })
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
] }),
|
|
127
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-4 !mb-20px", children: [
|
|
128
|
+
/* @__PURE__ */ e("label", { className: "w-40", children: "边框颜色" }),
|
|
129
|
+
/* @__PURE__ */ r("div", { className: "flex-1 flex gap-2 items-center", children: [
|
|
130
|
+
/* @__PURE__ */ e(
|
|
131
|
+
"input",
|
|
132
|
+
{
|
|
133
|
+
name: "borderColor",
|
|
134
|
+
value: a.style.borderColor,
|
|
135
|
+
readOnly: !0,
|
|
136
|
+
onChange: l,
|
|
137
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded h-30px"
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ e(
|
|
141
|
+
"input",
|
|
142
|
+
{
|
|
143
|
+
type: "color",
|
|
144
|
+
value: a.borderColor,
|
|
145
|
+
readOnly: !0,
|
|
146
|
+
onChange: (n) => o({ ...a, borderColor: n.target.value }),
|
|
147
|
+
className: "h-20px w-20px rounded cursor-pointer border"
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
] })
|
|
151
|
+
] }),
|
|
152
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-4 !mb-20px", children: [
|
|
153
|
+
/* @__PURE__ */ e("label", { className: "w-40", children: "字体位置" }),
|
|
154
|
+
/* @__PURE__ */ r(
|
|
155
|
+
"select",
|
|
156
|
+
{
|
|
157
|
+
name: "fontPosition",
|
|
158
|
+
value: a.style.textValign,
|
|
159
|
+
disabled: !0,
|
|
160
|
+
onChange: l,
|
|
161
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded bg-white",
|
|
162
|
+
children: [
|
|
163
|
+
/* @__PURE__ */ e("option", { value: "center", children: "居中" }),
|
|
164
|
+
/* @__PURE__ */ e("option", { value: "bottom", children: "底部" }),
|
|
165
|
+
/* @__PURE__ */ e("option", { value: "top", children: "顶部" })
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
] }),
|
|
170
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-4 !mb-20px", children: [
|
|
171
|
+
/* @__PURE__ */ e("label", { className: "w-40", children: "字体样式" }),
|
|
172
|
+
/* @__PURE__ */ e(
|
|
173
|
+
"input",
|
|
174
|
+
{
|
|
175
|
+
name: "fontStyle",
|
|
176
|
+
value: a.style.fontStyle,
|
|
177
|
+
readOnly: !0,
|
|
178
|
+
onChange: l,
|
|
179
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded "
|
|
180
|
+
}
|
|
181
|
+
)
|
|
182
|
+
] }),
|
|
183
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-4 !mb-20px", children: [
|
|
184
|
+
/* @__PURE__ */ e("label", { className: "w-40", children: "字体颜色" }),
|
|
185
|
+
/* @__PURE__ */ r("div", { className: "flex-1 flex gap-2 items-center", children: [
|
|
186
|
+
/* @__PURE__ */ e(
|
|
187
|
+
"input",
|
|
188
|
+
{
|
|
189
|
+
name: "fontColor",
|
|
190
|
+
readOnly: !0,
|
|
191
|
+
value: a.style.textBorderColor,
|
|
192
|
+
onChange: l,
|
|
193
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded h-30px"
|
|
194
|
+
}
|
|
195
|
+
),
|
|
196
|
+
/* @__PURE__ */ e(
|
|
197
|
+
"input",
|
|
198
|
+
{
|
|
199
|
+
type: "color",
|
|
200
|
+
readOnly: !0,
|
|
201
|
+
value: a.style["font-color"],
|
|
202
|
+
onChange: (n) => o({ ...a, fontColor: n.target.value }),
|
|
203
|
+
className: "h-20px w-20px rounded cursor-pointer border"
|
|
204
|
+
}
|
|
205
|
+
)
|
|
206
|
+
] })
|
|
207
|
+
] }),
|
|
208
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-4 !mb-20px", children: [
|
|
209
|
+
/* @__PURE__ */ e("label", { className: "w-40", children: "字体背色" }),
|
|
210
|
+
/* @__PURE__ */ e(
|
|
211
|
+
"input",
|
|
212
|
+
{
|
|
213
|
+
type: "text",
|
|
214
|
+
readOnly: !0,
|
|
215
|
+
value: a.style.textBackgroundColor,
|
|
216
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded bg-gray-50 text-gray-400 cursor-not-allowed"
|
|
217
|
+
}
|
|
218
|
+
)
|
|
219
|
+
] })
|
|
220
|
+
] }) })
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
});
|
|
224
|
+
export {
|
|
225
|
+
N as default
|
|
226
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as u, useContext as g, useState as o, useRef as m, useEffect as w, useImperativeHandle as C } from "react";
|
|
3
|
+
import { Drawer as h } from "antd";
|
|
4
|
+
import { fullSearchDetail as x } from "./index.es7.js";
|
|
5
|
+
import { GraphContext as y } from "./index.es15.js";
|
|
6
|
+
const G = u((D, l) => {
|
|
7
|
+
const { graphInfo: f } = g(y), [t, a] = o(!1), [I, s] = o(!1), [k, c] = o(!1), [v, d] = o({ style: {}, data: {} }), r = m(null);
|
|
8
|
+
w(() => {
|
|
9
|
+
t && r.current && (r.current.scrollTop = 0);
|
|
10
|
+
}, [t]), C(l, () => ({
|
|
11
|
+
open: (e) => {
|
|
12
|
+
a(!0), d(e), i(e);
|
|
13
|
+
},
|
|
14
|
+
close: () => a(!1)
|
|
15
|
+
}));
|
|
16
|
+
const i = async (e) => {
|
|
17
|
+
s(!0);
|
|
18
|
+
const p = await x({ kgId: f.kgId, uri: e.id });
|
|
19
|
+
console.log(44, e), c(p.data), s(!1);
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ n(
|
|
22
|
+
h,
|
|
23
|
+
{
|
|
24
|
+
title: "知识卡片",
|
|
25
|
+
onClose: () => {
|
|
26
|
+
a(!1);
|
|
27
|
+
},
|
|
28
|
+
open: t,
|
|
29
|
+
getContainer: !1,
|
|
30
|
+
className: "knowledge-card-drawer",
|
|
31
|
+
bodyStyle: { padding: "0 20px", overflow: "auto" },
|
|
32
|
+
children: /* @__PURE__ */ n("div", { ref: r, style: { height: "100%" } })
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
G as default
|
|
38
|
+
};
|