react-kggraph 0.0.16 → 0.0.18
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 +47 -1
- package/lib/index.es.js +8 -6
- package/lib/index.es10.js +186 -69
- package/lib/index.es11.js +71 -28
- package/lib/index.es12.js +29 -69
- package/lib/index.es13.js +70 -224
- package/lib/index.es14.js +224 -4
- package/lib/index.es15.js +4 -35
- package/lib/index.es16.js +37 -0
- package/lib/index.es18.js +15462 -49
- package/lib/index.es19.js +50 -56
- package/lib/index.es20.js +57 -66
- package/lib/index.es21.js +68 -39
- package/lib/index.es22.js +40 -2
- package/lib/index.es23.js +1 -1
- package/lib/index.es24.js +2 -2
- package/lib/index.es25.js +1 -1
- package/lib/index.es26.js +1 -1
- package/lib/index.es27.js +1 -1
- package/lib/index.es28.js +1 -1
- package/lib/index.es29.js +1 -1
- package/lib/index.es3.js +173 -155
- package/lib/index.es30.js +1 -1
- package/lib/index.es31.js +1 -1
- package/lib/index.es32.js +2 -2
- package/lib/index.es33.js +4 -0
- package/lib/index.es35.js +4 -2
- package/lib/index.es36.js +4 -0
- package/lib/index.es4.js +17 -6
- package/lib/index.es5.js +6 -2
- package/lib/index.es6.js +2 -599
- package/lib/index.es7.js +580 -312
- package/lib/index.es8.js +294 -393
- package/lib/index.es9.js +408 -173
- package/lib/src/components/Graph/components/ActionBar/actionList.d.ts +10 -0
- package/lib/src/components/Graph/components/ActionBar/index.d.ts +15 -0
- package/lib/src/components/Graph/types.d.ts +51 -0
- package/lib/src/components/Graph/utils/edge_node_styles.d.ts +5 -2
- package/lib/style.css +1 -1
- package/package.json +2 -8
- package/lib/index.es17.js +0 -15469
- package/lib/index.es34.js +0 -6
package/lib/index.es13.js
CHANGED
|
@@ -1,226 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
});
|
|
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
|
+
};
|
|
224
70
|
export {
|
|
225
|
-
|
|
71
|
+
L as default
|
|
226
72
|
};
|
package/lib/index.es14.js
CHANGED
|
@@ -1,6 +1,226 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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
|
+
});
|
|
3
224
|
export {
|
|
4
|
-
|
|
5
|
-
e as GraphProvider
|
|
225
|
+
N as default
|
|
6
226
|
};
|
package/lib/index.es15.js
CHANGED
|
@@ -1,37 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { Drawer as x } from "antd";
|
|
4
|
-
import { GraphContext as y } from "./index.es14.js";
|
|
5
|
-
const E = g((I, l) => {
|
|
6
|
-
const { graphInfo: d, knowledgeCardApi: f } = m(y), [t, a] = o(!1), [k, s] = o(!1), [D, c] = o(!1), [v, p] = o({ style: {}, data: {} }), r = w(null);
|
|
7
|
-
C(() => {
|
|
8
|
-
t && r.current && (r.current.scrollTop = 0);
|
|
9
|
-
}, [t]), h(l, () => ({
|
|
10
|
-
open: (e) => {
|
|
11
|
-
a(!0), p(e), i(e);
|
|
12
|
-
},
|
|
13
|
-
close: () => a(!1)
|
|
14
|
-
}));
|
|
15
|
-
const i = async (e) => {
|
|
16
|
-
s(!0);
|
|
17
|
-
const u = await f({ kgId: d.kgId, uri: e.id });
|
|
18
|
-
console.log(44, e), c(u.data), s(!1);
|
|
19
|
-
};
|
|
20
|
-
return /* @__PURE__ */ n(
|
|
21
|
-
x,
|
|
22
|
-
{
|
|
23
|
-
title: "知识卡片",
|
|
24
|
-
onClose: () => {
|
|
25
|
-
a(!1);
|
|
26
|
-
},
|
|
27
|
-
open: t,
|
|
28
|
-
getContainer: !1,
|
|
29
|
-
className: "knowledge-card-drawer",
|
|
30
|
-
bodyStyle: { padding: "0 20px", overflow: "auto" },
|
|
31
|
-
children: /* @__PURE__ */ n("div", { ref: r, style: { height: "100%" } })
|
|
32
|
-
}
|
|
33
|
-
);
|
|
34
|
-
});
|
|
1
|
+
import { createContext as r } from "react";
|
|
2
|
+
const o = r({}), e = o.Provider;
|
|
35
3
|
export {
|
|
36
|
-
|
|
4
|
+
o as GraphContext,
|
|
5
|
+
e as GraphProvider
|
|
37
6
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as g, useContext as m, useState as o, useRef as w, useEffect as C, useImperativeHandle as h } from "react";
|
|
3
|
+
import { Drawer as x } from "antd";
|
|
4
|
+
import { GraphContext as y } from "./index.es15.js";
|
|
5
|
+
const F = g((I, l) => {
|
|
6
|
+
const { graphInfo: d, knowledgeCardApi: f } = m(y), [t, a] = o(!1), [k, r] = o(!1), [D, c] = o(!1), [v, p] = o({ style: {}, data: {} }), s = w(null);
|
|
7
|
+
C(() => {
|
|
8
|
+
t && s.current && (s.current.scrollTop = 0);
|
|
9
|
+
}, [t]), h(l, () => ({
|
|
10
|
+
open: (e) => {
|
|
11
|
+
a(!0), p(e), i(e);
|
|
12
|
+
},
|
|
13
|
+
close: () => a(!1)
|
|
14
|
+
}));
|
|
15
|
+
const i = async (e) => {
|
|
16
|
+
r(!0);
|
|
17
|
+
const u = await f({ kgId: d.kgId, uri: e.id });
|
|
18
|
+
console.log(44, e), c(u.data), r(!1);
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ n(
|
|
21
|
+
x,
|
|
22
|
+
{
|
|
23
|
+
title: "知识卡片",
|
|
24
|
+
onClose: () => {
|
|
25
|
+
a(!1);
|
|
26
|
+
},
|
|
27
|
+
open: t,
|
|
28
|
+
getContainer: !1,
|
|
29
|
+
className: "knowledge-card-drawer",
|
|
30
|
+
styles: { body: { padding: "0 20px", overflow: "auto" } },
|
|
31
|
+
children: /* @__PURE__ */ n("div", { ref: s, style: { height: "100%" } })
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
export {
|
|
36
|
+
F as default
|
|
37
|
+
};
|