react-kggraph 0.0.1
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/README.md +16 -0
- package/lib/components/Graph/CytoscapeReact.css +1 -0
- package/lib/components/Graph/components/ActionBar/index.css +1 -0
- package/lib/components/Graph/components/PathAnalysis/index.css +1 -0
- package/lib/components/Graph/components/PathAnalysisLevel/index.css +1 -0
- package/lib/components/Graph/components/SettingCircle/index.css +1 -0
- package/lib/favicon.svg +1 -0
- package/lib/icons.svg +24 -0
- package/lib/index.cjs.js +1 -0
- package/lib/index.esm.js +3 -0
- package/lib/index10.cjs.js +1 -0
- package/lib/index10.esm.js +4 -0
- package/lib/index11.cjs.js +1 -0
- package/lib/index11.esm.js +4 -0
- package/lib/index12.cjs.js +1 -0
- package/lib/index12.esm.js +4 -0
- package/lib/index13.cjs.js +1 -0
- package/lib/index13.esm.js +4 -0
- package/lib/index14.cjs.js +1 -0
- package/lib/index14.esm.js +4 -0
- package/lib/index15.cjs.js +1 -0
- package/lib/index15.esm.js +4 -0
- package/lib/index16.cjs.js +1 -0
- package/lib/index16.esm.js +25 -0
- package/lib/index17.cjs.js +1 -0
- package/lib/index17.esm.js +330 -0
- package/lib/index18.cjs.js +1 -0
- package/lib/index18.esm.js +5 -0
- package/lib/index19.cjs.js +1 -0
- package/lib/index19.esm.js +284 -0
- package/lib/index2.cjs.js +1 -0
- package/lib/index2.esm.js +16 -0
- package/lib/index21.cjs.js +1 -0
- package/lib/index21.esm.js +27 -0
- package/lib/index22.cjs.js +16 -0
- package/lib/index22.esm.js +453 -0
- package/lib/index23.cjs.js +1 -0
- package/lib/index23.esm.js +10 -0
- package/lib/index24.cjs.js +1 -0
- package/lib/index24.esm.js +70 -0
- package/lib/index26.cjs.js +1 -0
- package/lib/index26.esm.js +68 -0
- package/lib/index28.cjs.js +1 -0
- package/lib/index28.esm.js +72 -0
- package/lib/index29.cjs.js +1 -0
- package/lib/index29.esm.js +32 -0
- package/lib/index30.cjs.js +1 -0
- package/lib/index30.esm.js +828 -0
- package/lib/index32.cjs.js +1 -0
- package/lib/index32.esm.js +4 -0
- package/lib/index33.cjs.js +1 -0
- package/lib/index33.esm.js +161 -0
- package/lib/index34.cjs.js +1 -0
- package/lib/index34.esm.js +71 -0
- package/lib/index36.cjs.js +1 -0
- package/lib/index36.esm.js +100 -0
- package/lib/index37.cjs.js +1 -0
- package/lib/index37.esm.js +250 -0
- package/lib/index38.cjs.js +1 -0
- package/lib/index38.esm.js +47 -0
- package/lib/index39.cjs.js +1 -0
- package/lib/index39.esm.js +378 -0
- package/lib/index4.cjs.js +95 -0
- package/lib/index4.esm.js +12387 -0
- package/lib/index40.cjs.js +1 -0
- package/lib/index40.esm.js +6 -0
- package/lib/index5.cjs.js +1 -0
- package/lib/index5.esm.js +4 -0
- package/lib/index6.cjs.js +1 -0
- package/lib/index6.esm.js +4 -0
- package/lib/index7.cjs.js +1 -0
- package/lib/index7.esm.js +4 -0
- package/lib/index8.cjs.js +1 -0
- package/lib/index8.esm.js +4 -0
- package/lib/index9.cjs.js +1 -0
- package/lib/index9.esm.js +4 -0
- package/lib/src/components/Graph/api.d.ts +2 -0
- package/lib/src/components/Graph/components/ActionBar/index.d.ts +9 -0
- package/lib/src/components/Graph/components/KnowledgeCard/index.d.ts +3 -0
- package/lib/src/components/Graph/components/NodeInfoDrawer/index.d.ts +3 -0
- package/lib/src/components/Graph/components/PathAnalysis/index.d.ts +9 -0
- package/lib/src/components/Graph/components/PathAnalysisLevel/index.d.ts +5 -0
- package/lib/src/components/Graph/components/QueryNode/index.d.ts +8 -0
- package/lib/src/components/Graph/components/SettingCircle/index.d.ts +13 -0
- package/lib/src/components/Graph/context.d.ts +2 -0
- package/lib/src/components/Graph/index.d.ts +8 -0
- package/lib/src/components/Graph/types.d.ts +6 -0
- package/lib/src/components/Graph/utils/edge_node_styles.d.ts +3 -0
- package/lib/src/components/Graph/utils/layouts.d.ts +108 -0
- package/lib/src/components/Graph/utils/menuItems.d.ts +1 -0
- package/lib/src/components/Graph/utils/tools.d.ts +38 -0
- package/package.json +64 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=e=>{},t=e=>{};exports.fullSearchDetail=t,exports.stepNext=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=[{selector:`node`,style:{"text-margin-y":`5px`}},{selector:`edge`,style:{"line-color":`#a29e9e`,"target-arrow-color":`#a29e9e`,opacity:1,"target-arrow-shape":`triangle`,width:2,"curve-style":`bezier`,"transition-property":`line-color, target-arrow-color, opacity`,"transition-duration":`0.2s`,label:`data(name)`,"z-index":9999,"text-opacity":1,"font-size":18,color:`#666`,"text-background-color":`#fff`,"text-background-opacity":1,"text-background-shape":`roundrectangle`,"text-background-padding":`3px`}},{selector:`.highlight`,style:{"border-color":`rgba(174, 255, 45, 0.2)`,"border-width":4}},{selector:`.path-node`,style:{"background-color":`#145AFD`,"border-color":`#FFEB3B`}},{selector:`.path-edge`,style:{"line-color":`#145AFD`,"target-arrow-color":`#145AFD`,width:4}},{selector:`.grayed`,style:{opacity:.15,"text-opacity":.15}},{selector:`node.selected, edge.selected`,style:{"border-color":`rgba(174, 255, 45, 0.2)`,"border-width":4}},{selector:`.correlationStyle`,style:{width:60,height:60,"outline-width":`10px`,"outline-color":`rgba(188, 220, 255, 0.4)`,"outline-style":`solid`,"line-opacity":`0.2`,"outline-offset":`2px`,filter:`blur(20px)`,"z-index":9999}},{selector:`.hover`,style:{"border-width":3,"border-color":`#0d6ac2`}},{selector:`.level-selected`,style:{"background-color":`#f8bbd0`,"border-color":`#e91e63`,"border-width":4,color:`#880e4f`}},{selector:`.level-highlight`,style:{"background-color":`#bbdefb`,"border-color":`#2196f3`,"border-width":3,color:`#0d47a1`}},{selector:`.level-highlightedge`,style:{"line-color":`#1976d2`,"target-arrow-color":`#1976d2`,width:3,opacity:1}},{selector:`.level-grayed`,style:{opacity:.15,"text-opacity":.15}}],t=({elements:t})=>{let n=[];t.map(e=>{!n.includes(e?.data?.type)&&e?.data?.type&&n.push(e.data?.type)});let r=[];return r.push({selector:`[properties-type="uri"]`,style:{"background-color":`#f7de63`,"background-image":`data(image)`,"background-fit":`cover`,width:80,height:80,label:`data(name)`,color:`black`,"text-valign":`bottom`,"font-size":18,"text-max-width":`250px`,"text-wrap":`ellipsis`,"text-overflow-wrap":`anywhere`}}),r.push({selector:`[properties-type!="uri"]`,style:{"background-color":`#1890FF`,"background-image":`data(image)`,"background-fit":`cover`,width:80,height:80,label:`data(name)`,color:`black`,"text-valign":`bottom`,"font-size":18,"text-max-width":`250px`,"text-wrap":`ellipsis`,"text-overflow-wrap":`anywhere`}}),r.concat(e)};exports.edgeNodeStyles=t;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
//#region src/components/Graph/utils/edge_node_styles.ts
|
|
2
|
+
var e = [
|
|
3
|
+
{
|
|
4
|
+
selector: "node",
|
|
5
|
+
style: { "text-margin-y": "5px" }
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
selector: "edge",
|
|
9
|
+
style: {
|
|
10
|
+
"line-color": "#a29e9e",
|
|
11
|
+
"target-arrow-color": "#a29e9e",
|
|
12
|
+
opacity: 1,
|
|
13
|
+
"target-arrow-shape": "triangle",
|
|
14
|
+
width: 2,
|
|
15
|
+
"curve-style": "bezier",
|
|
16
|
+
"transition-property": "line-color, target-arrow-color, opacity",
|
|
17
|
+
"transition-duration": "0.2s",
|
|
18
|
+
label: "data(name)",
|
|
19
|
+
"z-index": 9999,
|
|
20
|
+
"text-opacity": 1,
|
|
21
|
+
"font-size": 18,
|
|
22
|
+
color: "#666",
|
|
23
|
+
"text-background-color": "#fff",
|
|
24
|
+
"text-background-opacity": 1,
|
|
25
|
+
"text-background-shape": "roundrectangle",
|
|
26
|
+
"text-background-padding": "3px"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
selector: ".highlight",
|
|
31
|
+
style: {
|
|
32
|
+
"border-color": "rgba(174, 255, 45, 0.2)",
|
|
33
|
+
"border-width": 4
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
selector: ".path-node",
|
|
38
|
+
style: {
|
|
39
|
+
"background-color": "#145AFD",
|
|
40
|
+
"border-color": "#FFEB3B"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
selector: ".path-edge",
|
|
45
|
+
style: {
|
|
46
|
+
"line-color": "#145AFD",
|
|
47
|
+
"target-arrow-color": "#145AFD",
|
|
48
|
+
width: 4
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
selector: ".grayed",
|
|
53
|
+
style: {
|
|
54
|
+
opacity: .15,
|
|
55
|
+
"text-opacity": .15
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
selector: "node.selected, edge.selected",
|
|
60
|
+
style: {
|
|
61
|
+
"border-color": "rgba(174, 255, 45, 0.2)",
|
|
62
|
+
"border-width": 4
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
selector: ".correlationStyle",
|
|
67
|
+
style: {
|
|
68
|
+
width: 60,
|
|
69
|
+
height: 60,
|
|
70
|
+
"outline-width": "10px",
|
|
71
|
+
"outline-color": "rgba(188, 220, 255, 0.4)",
|
|
72
|
+
"outline-style": "solid",
|
|
73
|
+
"line-opacity": "0.2",
|
|
74
|
+
"outline-offset": "2px",
|
|
75
|
+
filter: "blur(20px)",
|
|
76
|
+
"z-index": 9999
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
selector: ".hover",
|
|
81
|
+
style: {
|
|
82
|
+
"border-width": 3,
|
|
83
|
+
"border-color": "#0d6ac2"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
selector: ".level-selected",
|
|
88
|
+
style: {
|
|
89
|
+
"background-color": "#f8bbd0",
|
|
90
|
+
"border-color": "#e91e63",
|
|
91
|
+
"border-width": 4,
|
|
92
|
+
color: "#880e4f"
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
selector: ".level-highlight",
|
|
97
|
+
style: {
|
|
98
|
+
"background-color": "#bbdefb",
|
|
99
|
+
"border-color": "#2196f3",
|
|
100
|
+
"border-width": 3,
|
|
101
|
+
color: "#0d47a1"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
selector: ".level-highlightedge",
|
|
106
|
+
style: {
|
|
107
|
+
"line-color": "#1976d2",
|
|
108
|
+
"target-arrow-color": "#1976d2",
|
|
109
|
+
width: 3,
|
|
110
|
+
opacity: 1
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
selector: ".level-grayed",
|
|
115
|
+
style: {
|
|
116
|
+
opacity: .15,
|
|
117
|
+
"text-opacity": .15
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
], t = ({ elements: t }) => {
|
|
121
|
+
let n = [];
|
|
122
|
+
t.map((e) => {
|
|
123
|
+
!n.includes(e?.data?.type) && e?.data?.type && n.push(e.data?.type);
|
|
124
|
+
});
|
|
125
|
+
let r = [];
|
|
126
|
+
return r.push({
|
|
127
|
+
selector: "[properties-type=\"uri\"]",
|
|
128
|
+
style: {
|
|
129
|
+
"background-color": "#f7de63",
|
|
130
|
+
"background-image": "data(image)",
|
|
131
|
+
"background-fit": "cover",
|
|
132
|
+
width: 80,
|
|
133
|
+
height: 80,
|
|
134
|
+
label: "data(name)",
|
|
135
|
+
color: "black",
|
|
136
|
+
"text-valign": "bottom",
|
|
137
|
+
"font-size": 18,
|
|
138
|
+
"text-max-width": "250px",
|
|
139
|
+
"text-wrap": "ellipsis",
|
|
140
|
+
"text-overflow-wrap": "anywhere"
|
|
141
|
+
}
|
|
142
|
+
}), r.push({
|
|
143
|
+
selector: "[properties-type!=\"uri\"]",
|
|
144
|
+
style: {
|
|
145
|
+
"background-color": "#1890FF",
|
|
146
|
+
"background-image": "data(image)",
|
|
147
|
+
"background-fit": "cover",
|
|
148
|
+
width: 80,
|
|
149
|
+
height: 80,
|
|
150
|
+
label: "data(name)",
|
|
151
|
+
color: "black",
|
|
152
|
+
"text-valign": "bottom",
|
|
153
|
+
"font-size": 18,
|
|
154
|
+
"text-max-width": "250px",
|
|
155
|
+
"text-wrap": "ellipsis",
|
|
156
|
+
"text-overflow-wrap": "anywhere"
|
|
157
|
+
}
|
|
158
|
+
}), r.concat(e);
|
|
159
|
+
};
|
|
160
|
+
//#endregion
|
|
161
|
+
export { t as edgeNodeStyles };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=({cyRef:e,setContextMenu:t,onPathAnalysis:n,setPathNodes:r})=>[{label:`展收实体`,ids:`contract`,action:t=>{let n=e.current;console.log(`新增属性`,n)}},{label:`展收属性`,ids:`expanded`,action:t=>{if(console.log(`展开`,t),!e.current){console.error(`Cytoscape instance is not available`);return}console.log(`New node and edge added`)}},{label:`节点信息`,ids:`nodeInfo`,action:e=>{console.log(`节点信息:`,e)}},{label:`知识卡片`,ids:`knowledgeCard`,action:t=>{let n=e.current;console.log(`知识卡片`,n)}},{label:`选中关联`,ids:`selRelate`,action:n=>{let r=e.current;if(!r||!n||n.removed()){console.error(`节点或Cytoscape实例无效`),t(e=>({...e,visible:!1}));return}let i=n,a=i.neighborhood().nodes().add(i);a.edgesWith(a),r.nodes().not(a).removeClass(`correlationStyle`),a.addClass(`correlationStyle`),t(e=>({...e,visible:!1}))}},{label:`路径分析`,action:t=>{e.current,console.log(11,t.data(`name`)),n?.(),r([t.data(`name`),``])}},{label:`删除节点`,action:t=>{let n=e.current;console.log(`删除节点cy::::`,n),t&&!t.removed()&&t.remove()}}];exports.menuItemsConfig=e;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
//#region src/components/Graph/utils/menuItems.ts
|
|
2
|
+
var e = ({ cyRef: e, setContextMenu: t, onPathAnalysis: n, setPathNodes: r }) => [
|
|
3
|
+
{
|
|
4
|
+
label: "展收实体",
|
|
5
|
+
ids: "contract",
|
|
6
|
+
action: (t) => {
|
|
7
|
+
let n = e.current;
|
|
8
|
+
console.log("新增属性", n);
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
label: "展收属性",
|
|
13
|
+
ids: "expanded",
|
|
14
|
+
action: (t) => {
|
|
15
|
+
if (console.log("展开", t), !e.current) {
|
|
16
|
+
console.error("Cytoscape instance is not available");
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
console.log("New node and edge added");
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: "节点信息",
|
|
24
|
+
ids: "nodeInfo",
|
|
25
|
+
action: (e) => {
|
|
26
|
+
console.log("节点信息:", e);
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: "知识卡片",
|
|
31
|
+
ids: "knowledgeCard",
|
|
32
|
+
action: (t) => {
|
|
33
|
+
let n = e.current;
|
|
34
|
+
console.log("知识卡片", n);
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: "选中关联",
|
|
39
|
+
ids: "selRelate",
|
|
40
|
+
action: (n) => {
|
|
41
|
+
let r = e.current;
|
|
42
|
+
if (!r || !n || n.removed()) {
|
|
43
|
+
console.error("节点或Cytoscape实例无效"), t((e) => ({
|
|
44
|
+
...e,
|
|
45
|
+
visible: !1
|
|
46
|
+
}));
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
let i = n, a = i.neighborhood().nodes().add(i);
|
|
50
|
+
a.edgesWith(a), r.nodes().not(a).removeClass("correlationStyle"), a.addClass("correlationStyle"), t((e) => ({
|
|
51
|
+
...e,
|
|
52
|
+
visible: !1
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: "路径分析",
|
|
58
|
+
action: (t) => {
|
|
59
|
+
e.current, console.log(11, t.data("name")), n?.(), r([t.data("name"), ""]);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: "删除节点",
|
|
64
|
+
action: (t) => {
|
|
65
|
+
let n = e.current;
|
|
66
|
+
console.log("删除节点cy::::", n), t && !t.removed() && t.remove();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
];
|
|
70
|
+
//#endregion
|
|
71
|
+
export { e as menuItemsConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./index2.cjs.js`),t=require(`./index23.cjs.js`);;/* empty css */let n=require(`react`);n=e.__toESM(n,1);var r=t.default,i=({items:e=[],centerImage:t,size:i=200,onClick:a})=>{let o=i/2,s=i/2-10,c=360/e.length,l=(0,n.useMemo)(()=>e.map((e,t)=>{let n=(t*c-90)*(Math.PI/180),r=((t+1)*c-90)*(Math.PI/180),i=((t+.5)*c-90)*(Math.PI/180),a=o+s*Math.cos(n),l=o+s*Math.sin(n),u=o+s*Math.cos(r),d=o+s*Math.sin(r),f=o+30*Math.cos(r),p=o+30*Math.sin(r),m=o+30*Math.cos(n),h=o+30*Math.sin(n),g=+(c>180),_=`M ${m} ${h} L ${a} ${l} A ${s} ${s} 0 ${g} 1 ${u} ${d} L ${f} ${p} A 30 30 0 ${g} 0 ${m} ${h}`,v=(s+30)/2+5,y=o+v*Math.cos(i),b=o+v*Math.sin(i);return{...e,path:_,textX:y,textY:b,rotation:(t+.5)*c-90}}),[e,c,o,s,30]);return(0,r.jsxs)(`div`,{className:`radial-menu`,style:{width:i,height:i},children:[(0,r.jsxs)(`svg`,{width:i,height:i,className:`radial-svg`,children:[(0,r.jsx)(`defs`,{children:(0,r.jsx)(`filter`,{id:`shadow`,x:`-20%`,y:`-20%`,width:`140%`,height:`140%`,children:(0,r.jsx)(`feDropShadow`,{dx:`0`,dy:`2`,stdDeviation:`3`,floodOpacity:`0.3`})})}),(0,r.jsx)(`circle`,{cx:o,cy:o,r:s,fill:`#f5f5f5`,stroke:`#ddd`,strokeWidth:`1`}),l.map((e,t)=>(200+t*25,(0,r.jsxs)(`g`,{onClick:()=>a(e),className:`sector-group`,children:[(0,r.jsx)(`path`,{d:e.path,fill:`#333`,stroke:`rgb(185, 185, 185)`,strokeWidth:`1`,filter:`url(#shadow)`,className:`sector-path`}),(0,r.jsx)(`text`,{x:e.textX,y:e.textY,textAnchor:`middle`,dominantBaseline:`middle`,fill:`#fff`,fontSize:`12`,fontWeight:`500`,className:`sector-label`,children:e.label})]},t))),(0,r.jsx)(`circle`,{cx:o,cy:o,r:32,fill:`#fff`})]}),(0,r.jsx)(`div`,{className:`center-avatar`,style:{width:60,height:60},children:t?(0,r.jsx)(`img`,{src:t,alt:`avatar`}):(0,r.jsx)(`span`,{className:`center-text`,children:`菜单`})})]})};exports.default=i;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { require_jsx_runtime as e } from "./index23.esm.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { useMemo as t } from "react";
|
|
4
|
+
//#region src/components/Graph/components/SettingCircle/index.tsx
|
|
5
|
+
var n = e(), r = ({ items: e = [], centerImage: r, size: i = 200, onClick: a }) => {
|
|
6
|
+
let o = i / 2, s = i / 2 - 10, c = 360 / e.length, l = t(() => e.map((e, t) => {
|
|
7
|
+
let n = (t * c - 90) * (Math.PI / 180), r = ((t + 1) * c - 90) * (Math.PI / 180), i = ((t + .5) * c - 90) * (Math.PI / 180), a = o + s * Math.cos(n), l = o + s * Math.sin(n), u = o + s * Math.cos(r), d = o + s * Math.sin(r), f = o + 30 * Math.cos(r), p = o + 30 * Math.sin(r), m = o + 30 * Math.cos(n), h = o + 30 * Math.sin(n), g = +(c > 180), _ = `M ${m} ${h} L ${a} ${l} A ${s} ${s} 0 ${g} 1 ${u} ${d} L ${f} ${p} A 30 30 0 ${g} 0 ${m} ${h}`, v = (s + 30) / 2 + 5, y = o + v * Math.cos(i), b = o + v * Math.sin(i);
|
|
8
|
+
return {
|
|
9
|
+
...e,
|
|
10
|
+
path: _,
|
|
11
|
+
textX: y,
|
|
12
|
+
textY: b,
|
|
13
|
+
rotation: (t + .5) * c - 90
|
|
14
|
+
};
|
|
15
|
+
}), [
|
|
16
|
+
e,
|
|
17
|
+
c,
|
|
18
|
+
o,
|
|
19
|
+
s,
|
|
20
|
+
30
|
|
21
|
+
]);
|
|
22
|
+
return /* @__PURE__ */ (0, n.jsxs)("div", {
|
|
23
|
+
className: "radial-menu",
|
|
24
|
+
style: {
|
|
25
|
+
width: i,
|
|
26
|
+
height: i
|
|
27
|
+
},
|
|
28
|
+
children: [/* @__PURE__ */ (0, n.jsxs)("svg", {
|
|
29
|
+
width: i,
|
|
30
|
+
height: i,
|
|
31
|
+
className: "radial-svg",
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ (0, n.jsx)("defs", { children: /* @__PURE__ */ (0, n.jsx)("filter", {
|
|
34
|
+
id: "shadow",
|
|
35
|
+
x: "-20%",
|
|
36
|
+
y: "-20%",
|
|
37
|
+
width: "140%",
|
|
38
|
+
height: "140%",
|
|
39
|
+
children: /* @__PURE__ */ (0, n.jsx)("feDropShadow", {
|
|
40
|
+
dx: "0",
|
|
41
|
+
dy: "2",
|
|
42
|
+
stdDeviation: "3",
|
|
43
|
+
floodOpacity: "0.3"
|
|
44
|
+
})
|
|
45
|
+
}) }),
|
|
46
|
+
/* @__PURE__ */ (0, n.jsx)("circle", {
|
|
47
|
+
cx: o,
|
|
48
|
+
cy: o,
|
|
49
|
+
r: s,
|
|
50
|
+
fill: "#f5f5f5",
|
|
51
|
+
stroke: "#ddd",
|
|
52
|
+
strokeWidth: "1"
|
|
53
|
+
}),
|
|
54
|
+
l.map((e, t) => (200 + t * 25, /* @__PURE__ */ (0, n.jsxs)("g", {
|
|
55
|
+
onClick: () => a(e),
|
|
56
|
+
className: "sector-group",
|
|
57
|
+
children: [/* @__PURE__ */ (0, n.jsx)("path", {
|
|
58
|
+
d: e.path,
|
|
59
|
+
fill: "#333",
|
|
60
|
+
stroke: "rgb(185, 185, 185)",
|
|
61
|
+
strokeWidth: "1",
|
|
62
|
+
filter: "url(#shadow)",
|
|
63
|
+
className: "sector-path"
|
|
64
|
+
}), /* @__PURE__ */ (0, n.jsx)("text", {
|
|
65
|
+
x: e.textX,
|
|
66
|
+
y: e.textY,
|
|
67
|
+
textAnchor: "middle",
|
|
68
|
+
dominantBaseline: "middle",
|
|
69
|
+
fill: "#fff",
|
|
70
|
+
fontSize: "12",
|
|
71
|
+
fontWeight: "500",
|
|
72
|
+
className: "sector-label",
|
|
73
|
+
children: e.label
|
|
74
|
+
})]
|
|
75
|
+
}, t))),
|
|
76
|
+
/* @__PURE__ */ (0, n.jsx)("circle", {
|
|
77
|
+
cx: o,
|
|
78
|
+
cy: o,
|
|
79
|
+
r: 32,
|
|
80
|
+
fill: "#fff"
|
|
81
|
+
})
|
|
82
|
+
]
|
|
83
|
+
}), /* @__PURE__ */ (0, n.jsx)("div", {
|
|
84
|
+
className: "center-avatar",
|
|
85
|
+
style: {
|
|
86
|
+
width: 60,
|
|
87
|
+
height: 60
|
|
88
|
+
},
|
|
89
|
+
children: r ? /* @__PURE__ */ (0, n.jsx)("img", {
|
|
90
|
+
src: r,
|
|
91
|
+
alt: "avatar"
|
|
92
|
+
}) : /* @__PURE__ */ (0, n.jsx)("span", {
|
|
93
|
+
className: "center-text",
|
|
94
|
+
children: "菜单"
|
|
95
|
+
})
|
|
96
|
+
})]
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
//#endregion
|
|
100
|
+
export { r as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./index2.cjs.js`),t=require(`./index23.cjs.js`);let n=require(`react`);n=e.__toESM(n,1);let r=require(`antd`);var i=t.default,a=(0,n.forwardRef)((e,t)=>{let[a,o]=(0,n.useState)(!1),[s,c]=(0,n.useState)({style:{},data:{}});(0,n.useImperativeHandle)(t,()=>({open:e=>{o(!0),c(e)},close:()=>o(!1)}));let l=()=>{o(!1)},u=e=>{let{name:t,value:n}=e.target;c(e=>({...e,[t]:n}))};return(0,i.jsx)(r.Drawer,{title:`节点配置`,closable:{"aria-label":`Close Button`},onClose:l,open:a,getContainer:!1,children:(0,i.jsx)(`div`,{className:`h-full overflow-y-auto z-50`,children:(0,i.jsxs)(`div`,{className:`space-y-4`,children:[(0,i.jsxs)(`div`,{className:`flex items-center gap-4 !mb-20px`,children:[(0,i.jsx)(`label`,{className:`w-40`,children:`名称`}),(0,i.jsx)(`input`,{name:`name`,value:s.data.name,onChange:u,readOnly:!0,className:`flex-1 px-3 py-1.5 border border-gray-300 rounded focus:outline-none focus:ring-1 focus:ring-blue-500`})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-4 !mb-20px`,children:[(0,i.jsx)(`label`,{className:`w-40`,children:`类型`}),(0,i.jsxs)(`select`,{name:`type`,value:s.type,disabled:!0,onChange:u,className:`flex-1 px-3 py-1.5 border border-gray-300 rounded bg-white`,children:[(0,i.jsx)(`option`,{value:`圆形`,children:`圆形`}),(0,i.jsx)(`option`,{value:`矩形`,children:`矩形`})]})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-4 !mb-20px`,children:[(0,i.jsx)(`label`,{className:`w-40`,children:`颜色`}),(0,i.jsxs)(`div`,{className:`flex-1 flex gap-2 items-center`,children:[(0,i.jsx)(`input`,{name:`color`,readOnly:!0,value:s.style.color,onChange:u,className:`flex-1 px-3 py-1.5 border border-gray-300 rounded h-30px`}),(0,i.jsx)(`input`,{type:`color`,readOnly:!0,value:s.style.color,onChange:e=>c({...s,color:e.target.value}),className:`h-20px w-20px rounded cursor-pointer border`})]})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-4 !mb-20px`,children:[(0,i.jsx)(`label`,{className:`w-40`,children:`大小`}),(0,i.jsx)(`input`,{type:`number`,name:`size`,readOnly:!0,value:parseInt(s.style.height),onChange:u,className:`flex-1 px-3 py-1.5 border border-gray-300 rounded `})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-4 !mb-20px`,children:[(0,i.jsx)(`label`,{className:`w-40`,children:`边框宽度`}),(0,i.jsx)(`input`,{type:`number`,name:`borderWidth`,readOnly:!0,value:parseInt(s.style.borderWidth),onChange:u,className:`flex-1 px-3 py-1.5 border border-gray-300 rounded `})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-4 !mb-20px`,children:[(0,i.jsx)(`label`,{className:`w-40`,children:`边框虚线`}),(0,i.jsxs)(`select`,{name:`borderDash`,value:s.style.borderDash,disabled:!0,onChange:u,className:`flex-1 px-3 py-1.5 border border-gray-300 rounded bg-white`,children:[(0,i.jsx)(`option`,{value:`否`,children:`否`}),(0,i.jsx)(`option`,{value:`是`,children:`是`})]})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-4 !mb-20px`,children:[(0,i.jsx)(`label`,{className:`w-40`,children:`边框颜色`}),(0,i.jsxs)(`div`,{className:`flex-1 flex gap-2 items-center`,children:[(0,i.jsx)(`input`,{name:`borderColor`,value:s.style.borderColor,readOnly:!0,onChange:u,className:`flex-1 px-3 py-1.5 border border-gray-300 rounded h-30px`}),(0,i.jsx)(`input`,{type:`color`,value:s.borderColor,readOnly:!0,onChange:e=>c({...s,borderColor:e.target.value}),className:`h-20px w-20px rounded cursor-pointer border`})]})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-4 !mb-20px`,children:[(0,i.jsx)(`label`,{className:`w-40`,children:`字体位置`}),(0,i.jsxs)(`select`,{name:`fontPosition`,value:s.style.textValign,disabled:!0,onChange:u,className:`flex-1 px-3 py-1.5 border border-gray-300 rounded bg-white`,children:[(0,i.jsx)(`option`,{value:`center`,children:`居中`}),(0,i.jsx)(`option`,{value:`bottom`,children:`底部`}),(0,i.jsx)(`option`,{value:`top`,children:`顶部`})]})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-4 !mb-20px`,children:[(0,i.jsx)(`label`,{className:`w-40`,children:`字体样式`}),(0,i.jsx)(`input`,{name:`fontStyle`,value:s.style.fontStyle,readOnly:!0,onChange:u,className:`flex-1 px-3 py-1.5 border border-gray-300 rounded `})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-4 !mb-20px`,children:[(0,i.jsx)(`label`,{className:`w-40`,children:`字体颜色`}),(0,i.jsxs)(`div`,{className:`flex-1 flex gap-2 items-center`,children:[(0,i.jsx)(`input`,{name:`fontColor`,readOnly:!0,value:s.style.textBorderColor,onChange:u,className:`flex-1 px-3 py-1.5 border border-gray-300 rounded h-30px`}),(0,i.jsx)(`input`,{type:`color`,readOnly:!0,value:s.style[`font-color`],onChange:e=>c({...s,fontColor:e.target.value}),className:`h-20px w-20px rounded cursor-pointer border`})]})]}),(0,i.jsxs)(`div`,{className:`flex items-center gap-4 !mb-20px`,children:[(0,i.jsx)(`label`,{className:`w-40`,children:`字体背色`}),(0,i.jsx)(`input`,{type:`text`,readOnly:!0,value:s.style.textBackgroundColor,className:`flex-1 px-3 py-1.5 border border-gray-300 rounded bg-gray-50 text-gray-400 cursor-not-allowed`})]})]})})})});exports.default=a;
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { require_jsx_runtime as e } from "./index23.esm.js";
|
|
2
|
+
import { forwardRef as t, useImperativeHandle as n, useState as r } from "react";
|
|
3
|
+
import { Drawer as i } from "antd";
|
|
4
|
+
//#region src/components/Graph/components/NodeInfoDrawer/index.tsx
|
|
5
|
+
var a = e(), o = t((e, t) => {
|
|
6
|
+
let [o, s] = r(!1), [c, l] = r({
|
|
7
|
+
style: {},
|
|
8
|
+
data: {}
|
|
9
|
+
});
|
|
10
|
+
n(t, () => ({
|
|
11
|
+
open: (e) => {
|
|
12
|
+
s(!0), l(e);
|
|
13
|
+
},
|
|
14
|
+
close: () => s(!1)
|
|
15
|
+
}));
|
|
16
|
+
let u = () => {
|
|
17
|
+
s(!1);
|
|
18
|
+
}, d = (e) => {
|
|
19
|
+
let { name: t, value: n } = e.target;
|
|
20
|
+
l((e) => ({
|
|
21
|
+
...e,
|
|
22
|
+
[t]: n
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
return /* @__PURE__ */ (0, a.jsx)(i, {
|
|
26
|
+
title: "节点配置",
|
|
27
|
+
closable: { "aria-label": "Close Button" },
|
|
28
|
+
onClose: u,
|
|
29
|
+
open: o,
|
|
30
|
+
getContainer: !1,
|
|
31
|
+
children: /* @__PURE__ */ (0, a.jsx)("div", {
|
|
32
|
+
className: "h-full overflow-y-auto z-50",
|
|
33
|
+
children: /* @__PURE__ */ (0, a.jsxs)("div", {
|
|
34
|
+
className: "space-y-4",
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ (0, a.jsxs)("div", {
|
|
37
|
+
className: "flex items-center gap-4 !mb-20px",
|
|
38
|
+
children: [/* @__PURE__ */ (0, a.jsx)("label", {
|
|
39
|
+
className: "w-40",
|
|
40
|
+
children: "名称"
|
|
41
|
+
}), /* @__PURE__ */ (0, a.jsx)("input", {
|
|
42
|
+
name: "name",
|
|
43
|
+
value: c.data.name,
|
|
44
|
+
onChange: d,
|
|
45
|
+
readOnly: !0,
|
|
46
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded focus:outline-none focus:ring-1 focus:ring-blue-500"
|
|
47
|
+
})]
|
|
48
|
+
}),
|
|
49
|
+
/* @__PURE__ */ (0, a.jsxs)("div", {
|
|
50
|
+
className: "flex items-center gap-4 !mb-20px",
|
|
51
|
+
children: [/* @__PURE__ */ (0, a.jsx)("label", {
|
|
52
|
+
className: "w-40",
|
|
53
|
+
children: "类型"
|
|
54
|
+
}), /* @__PURE__ */ (0, a.jsxs)("select", {
|
|
55
|
+
name: "type",
|
|
56
|
+
value: c.type,
|
|
57
|
+
disabled: !0,
|
|
58
|
+
onChange: d,
|
|
59
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded bg-white",
|
|
60
|
+
children: [/* @__PURE__ */ (0, a.jsx)("option", {
|
|
61
|
+
value: "圆形",
|
|
62
|
+
children: "圆形"
|
|
63
|
+
}), /* @__PURE__ */ (0, a.jsx)("option", {
|
|
64
|
+
value: "矩形",
|
|
65
|
+
children: "矩形"
|
|
66
|
+
})]
|
|
67
|
+
})]
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ (0, a.jsxs)("div", {
|
|
70
|
+
className: "flex items-center gap-4 !mb-20px",
|
|
71
|
+
children: [/* @__PURE__ */ (0, a.jsx)("label", {
|
|
72
|
+
className: "w-40",
|
|
73
|
+
children: "颜色"
|
|
74
|
+
}), /* @__PURE__ */ (0, a.jsxs)("div", {
|
|
75
|
+
className: "flex-1 flex gap-2 items-center",
|
|
76
|
+
children: [/* @__PURE__ */ (0, a.jsx)("input", {
|
|
77
|
+
name: "color",
|
|
78
|
+
readOnly: !0,
|
|
79
|
+
value: c.style.color,
|
|
80
|
+
onChange: d,
|
|
81
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded h-30px"
|
|
82
|
+
}), /* @__PURE__ */ (0, a.jsx)("input", {
|
|
83
|
+
type: "color",
|
|
84
|
+
readOnly: !0,
|
|
85
|
+
value: c.style.color,
|
|
86
|
+
onChange: (e) => l({
|
|
87
|
+
...c,
|
|
88
|
+
color: e.target.value
|
|
89
|
+
}),
|
|
90
|
+
className: "h-20px w-20px rounded cursor-pointer border"
|
|
91
|
+
})]
|
|
92
|
+
})]
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ (0, a.jsxs)("div", {
|
|
95
|
+
className: "flex items-center gap-4 !mb-20px",
|
|
96
|
+
children: [/* @__PURE__ */ (0, a.jsx)("label", {
|
|
97
|
+
className: "w-40",
|
|
98
|
+
children: "大小"
|
|
99
|
+
}), /* @__PURE__ */ (0, a.jsx)("input", {
|
|
100
|
+
type: "number",
|
|
101
|
+
name: "size",
|
|
102
|
+
readOnly: !0,
|
|
103
|
+
value: parseInt(c.style.height),
|
|
104
|
+
onChange: d,
|
|
105
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded "
|
|
106
|
+
})]
|
|
107
|
+
}),
|
|
108
|
+
/* @__PURE__ */ (0, a.jsxs)("div", {
|
|
109
|
+
className: "flex items-center gap-4 !mb-20px",
|
|
110
|
+
children: [/* @__PURE__ */ (0, a.jsx)("label", {
|
|
111
|
+
className: "w-40",
|
|
112
|
+
children: "边框宽度"
|
|
113
|
+
}), /* @__PURE__ */ (0, a.jsx)("input", {
|
|
114
|
+
type: "number",
|
|
115
|
+
name: "borderWidth",
|
|
116
|
+
readOnly: !0,
|
|
117
|
+
value: parseInt(c.style.borderWidth),
|
|
118
|
+
onChange: d,
|
|
119
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded "
|
|
120
|
+
})]
|
|
121
|
+
}),
|
|
122
|
+
/* @__PURE__ */ (0, a.jsxs)("div", {
|
|
123
|
+
className: "flex items-center gap-4 !mb-20px",
|
|
124
|
+
children: [/* @__PURE__ */ (0, a.jsx)("label", {
|
|
125
|
+
className: "w-40",
|
|
126
|
+
children: "边框虚线"
|
|
127
|
+
}), /* @__PURE__ */ (0, a.jsxs)("select", {
|
|
128
|
+
name: "borderDash",
|
|
129
|
+
value: c.style.borderDash,
|
|
130
|
+
disabled: !0,
|
|
131
|
+
onChange: d,
|
|
132
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded bg-white",
|
|
133
|
+
children: [/* @__PURE__ */ (0, a.jsx)("option", {
|
|
134
|
+
value: "否",
|
|
135
|
+
children: "否"
|
|
136
|
+
}), /* @__PURE__ */ (0, a.jsx)("option", {
|
|
137
|
+
value: "是",
|
|
138
|
+
children: "是"
|
|
139
|
+
})]
|
|
140
|
+
})]
|
|
141
|
+
}),
|
|
142
|
+
/* @__PURE__ */ (0, a.jsxs)("div", {
|
|
143
|
+
className: "flex items-center gap-4 !mb-20px",
|
|
144
|
+
children: [/* @__PURE__ */ (0, a.jsx)("label", {
|
|
145
|
+
className: "w-40",
|
|
146
|
+
children: "边框颜色"
|
|
147
|
+
}), /* @__PURE__ */ (0, a.jsxs)("div", {
|
|
148
|
+
className: "flex-1 flex gap-2 items-center",
|
|
149
|
+
children: [/* @__PURE__ */ (0, a.jsx)("input", {
|
|
150
|
+
name: "borderColor",
|
|
151
|
+
value: c.style.borderColor,
|
|
152
|
+
readOnly: !0,
|
|
153
|
+
onChange: d,
|
|
154
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded h-30px"
|
|
155
|
+
}), /* @__PURE__ */ (0, a.jsx)("input", {
|
|
156
|
+
type: "color",
|
|
157
|
+
value: c.borderColor,
|
|
158
|
+
readOnly: !0,
|
|
159
|
+
onChange: (e) => l({
|
|
160
|
+
...c,
|
|
161
|
+
borderColor: e.target.value
|
|
162
|
+
}),
|
|
163
|
+
className: "h-20px w-20px rounded cursor-pointer border"
|
|
164
|
+
})]
|
|
165
|
+
})]
|
|
166
|
+
}),
|
|
167
|
+
/* @__PURE__ */ (0, a.jsxs)("div", {
|
|
168
|
+
className: "flex items-center gap-4 !mb-20px",
|
|
169
|
+
children: [/* @__PURE__ */ (0, a.jsx)("label", {
|
|
170
|
+
className: "w-40",
|
|
171
|
+
children: "字体位置"
|
|
172
|
+
}), /* @__PURE__ */ (0, a.jsxs)("select", {
|
|
173
|
+
name: "fontPosition",
|
|
174
|
+
value: c.style.textValign,
|
|
175
|
+
disabled: !0,
|
|
176
|
+
onChange: d,
|
|
177
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded bg-white",
|
|
178
|
+
children: [
|
|
179
|
+
/* @__PURE__ */ (0, a.jsx)("option", {
|
|
180
|
+
value: "center",
|
|
181
|
+
children: "居中"
|
|
182
|
+
}),
|
|
183
|
+
/* @__PURE__ */ (0, a.jsx)("option", {
|
|
184
|
+
value: "bottom",
|
|
185
|
+
children: "底部"
|
|
186
|
+
}),
|
|
187
|
+
/* @__PURE__ */ (0, a.jsx)("option", {
|
|
188
|
+
value: "top",
|
|
189
|
+
children: "顶部"
|
|
190
|
+
})
|
|
191
|
+
]
|
|
192
|
+
})]
|
|
193
|
+
}),
|
|
194
|
+
/* @__PURE__ */ (0, a.jsxs)("div", {
|
|
195
|
+
className: "flex items-center gap-4 !mb-20px",
|
|
196
|
+
children: [/* @__PURE__ */ (0, a.jsx)("label", {
|
|
197
|
+
className: "w-40",
|
|
198
|
+
children: "字体样式"
|
|
199
|
+
}), /* @__PURE__ */ (0, a.jsx)("input", {
|
|
200
|
+
name: "fontStyle",
|
|
201
|
+
value: c.style.fontStyle,
|
|
202
|
+
readOnly: !0,
|
|
203
|
+
onChange: d,
|
|
204
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded "
|
|
205
|
+
})]
|
|
206
|
+
}),
|
|
207
|
+
/* @__PURE__ */ (0, a.jsxs)("div", {
|
|
208
|
+
className: "flex items-center gap-4 !mb-20px",
|
|
209
|
+
children: [/* @__PURE__ */ (0, a.jsx)("label", {
|
|
210
|
+
className: "w-40",
|
|
211
|
+
children: "字体颜色"
|
|
212
|
+
}), /* @__PURE__ */ (0, a.jsxs)("div", {
|
|
213
|
+
className: "flex-1 flex gap-2 items-center",
|
|
214
|
+
children: [/* @__PURE__ */ (0, a.jsx)("input", {
|
|
215
|
+
name: "fontColor",
|
|
216
|
+
readOnly: !0,
|
|
217
|
+
value: c.style.textBorderColor,
|
|
218
|
+
onChange: d,
|
|
219
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded h-30px"
|
|
220
|
+
}), /* @__PURE__ */ (0, a.jsx)("input", {
|
|
221
|
+
type: "color",
|
|
222
|
+
readOnly: !0,
|
|
223
|
+
value: c.style["font-color"],
|
|
224
|
+
onChange: (e) => l({
|
|
225
|
+
...c,
|
|
226
|
+
fontColor: e.target.value
|
|
227
|
+
}),
|
|
228
|
+
className: "h-20px w-20px rounded cursor-pointer border"
|
|
229
|
+
})]
|
|
230
|
+
})]
|
|
231
|
+
}),
|
|
232
|
+
/* @__PURE__ */ (0, a.jsxs)("div", {
|
|
233
|
+
className: "flex items-center gap-4 !mb-20px",
|
|
234
|
+
children: [/* @__PURE__ */ (0, a.jsx)("label", {
|
|
235
|
+
className: "w-40",
|
|
236
|
+
children: "字体背色"
|
|
237
|
+
}), /* @__PURE__ */ (0, a.jsx)("input", {
|
|
238
|
+
type: "text",
|
|
239
|
+
readOnly: !0,
|
|
240
|
+
value: c.style.textBackgroundColor,
|
|
241
|
+
className: "flex-1 px-3 py-1.5 border border-gray-300 rounded bg-gray-50 text-gray-400 cursor-not-allowed"
|
|
242
|
+
})]
|
|
243
|
+
})
|
|
244
|
+
]
|
|
245
|
+
})
|
|
246
|
+
})
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
//#endregion
|
|
250
|
+
export { o as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./index2.cjs.js`),t=require(`./index18.cjs.js`),n=require(`./index23.cjs.js`),r=require(`./index32.cjs.js`);let i=require(`react`);i=e.__toESM(i,1);let a=require(`antd`);var o=n.default,s=(0,i.forwardRef)((e,n)=>{let{graphInfo:s}=(0,i.useContext)(t.GraphContext),[c,l]=(0,i.useState)(!1),[u,d]=(0,i.useState)(!1),[f,p]=(0,i.useState)(!1),[m,h]=(0,i.useState)({style:{},data:{}}),g=(0,i.useRef)(null);(0,i.useEffect)(()=>{c&&g.current&&(g.current.scrollTop=0)},[c]),(0,i.useImperativeHandle)(n,()=>({open:e=>{l(!0),h(e),_(e)},close:()=>l(!1)}));let _=async e=>{d(!0);let t=await r.fullSearchDetail({kgId:s.kgId,uri:e.id});console.log(44,e),p(t.data),d(!1)};return(0,o.jsx)(a.Drawer,{title:`知识卡片`,onClose:()=>{l(!1)},open:c,getContainer:!1,className:`knowledge-card-drawer`,bodyStyle:{padding:`0 20px`,overflow:`auto`},children:(0,o.jsx)(`div`,{ref:g,style:{height:`100%`}})})});exports.default=s;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { GraphContext as e } from "./index18.esm.js";
|
|
2
|
+
import { require_jsx_runtime as t } from "./index23.esm.js";
|
|
3
|
+
import { fullSearchDetail as n } from "./index32.esm.js";
|
|
4
|
+
import { forwardRef as r, useContext as i, useEffect as a, useImperativeHandle as o, useRef as s, useState as c } from "react";
|
|
5
|
+
import { Drawer as l } from "antd";
|
|
6
|
+
//#region src/components/Graph/components/KnowledgeCard/index.tsx
|
|
7
|
+
var u = t(), d = r((t, r) => {
|
|
8
|
+
let { graphInfo: d } = i(e), [f, p] = c(!1), [m, h] = c(!1), [g, _] = c(!1), [v, y] = c({
|
|
9
|
+
style: {},
|
|
10
|
+
data: {}
|
|
11
|
+
}), b = s(null);
|
|
12
|
+
a(() => {
|
|
13
|
+
f && b.current && (b.current.scrollTop = 0);
|
|
14
|
+
}, [f]), o(r, () => ({
|
|
15
|
+
open: (e) => {
|
|
16
|
+
p(!0), y(e), x(e);
|
|
17
|
+
},
|
|
18
|
+
close: () => p(!1)
|
|
19
|
+
}));
|
|
20
|
+
let x = async (e) => {
|
|
21
|
+
h(!0);
|
|
22
|
+
let t = await n({
|
|
23
|
+
kgId: d.kgId,
|
|
24
|
+
uri: e.id
|
|
25
|
+
});
|
|
26
|
+
console.log(44, e), _(t.data), h(!1);
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ (0, u.jsx)(l, {
|
|
29
|
+
title: "知识卡片",
|
|
30
|
+
onClose: () => {
|
|
31
|
+
p(!1);
|
|
32
|
+
},
|
|
33
|
+
open: f,
|
|
34
|
+
getContainer: !1,
|
|
35
|
+
className: "knowledge-card-drawer",
|
|
36
|
+
bodyStyle: {
|
|
37
|
+
padding: "0 20px",
|
|
38
|
+
overflow: "auto"
|
|
39
|
+
},
|
|
40
|
+
children: /* @__PURE__ */ (0, u.jsx)("div", {
|
|
41
|
+
ref: b,
|
|
42
|
+
style: { height: "100%" }
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
//#endregion
|
|
47
|
+
export { d as default };
|