react-kggraph 0.0.26 → 0.0.28
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.es16.js +2 -2
- package/lib/index.es3.js +162 -154
- package/lib/index.es35.js +2 -2
- package/lib/index.es36.js +4 -0
- package/lib/index.es38.js +62 -1045
- package/lib/index.es39.js +1046 -18
- package/lib/index.es43.js +17 -54
- package/lib/index.es44.js +40 -30
- package/lib/index.es47.js +58 -0
- package/lib/index.es48.js +33 -0
- package/lib/index.es7.js +252 -247
- package/lib/index.es8.js +153 -132
- package/lib/src/components/Graph/utils/tools.d.ts +2 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/lib/index.es37.js +0 -66
- package/lib/index.es40.js +0 -43
- /package/lib/{index.es41.js → index.es45.js} +0 -0
- /package/lib/{index.es42.js → index.es46.js} +0 -0
- /package/lib/{index.es49.js → index.es50.js} +0 -0
package/lib/index.es43.js
CHANGED
|
@@ -1,58 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
var t, i;
|
|
7
|
-
if (s === e)
|
|
8
|
-
(t = n.current[e]) == null || t.pause(), a(null);
|
|
9
|
-
else {
|
|
10
|
-
if (s && ((i = n.current[s]) == null || i.pause()), a(e), !n.current[e]) {
|
|
11
|
-
const c = new Audio(e);
|
|
12
|
-
n.current[e] = c;
|
|
13
|
-
}
|
|
14
|
-
n.current[e].play(), n.current[e].onended = () => a(null);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
return /* @__PURE__ */ l(
|
|
18
|
-
"div",
|
|
19
|
-
{
|
|
20
|
-
className: f === "qa-card" ? "grid grid-cols-1" : `grid ${u ? "grid-cols-1 gap-y-3" : "grid-cols-2 gap-x-100px gap-y-20px"}`,
|
|
21
|
-
children: m.map((e, t) => {
|
|
22
|
-
const i = e.propertyValue.split("/").pop() || "未命名音频", c = s === e.propertyValue;
|
|
23
|
-
return /* @__PURE__ */ o(d, { className: "flex items-center justify-between transition-all", justify: "space-between", align: "middle", children: [
|
|
24
|
-
/* @__PURE__ */ o(d, { className: "flex items-center min-w-0 flex-1", align: "middle", children: [
|
|
25
|
-
/* @__PURE__ */ l("div", { className: "mr-3 text-xl flex-shrink-0", children: /* @__PURE__ */ l("span", { className: "w-24px h-30px i-custom-audio inline-block" }) }),
|
|
26
|
-
/* @__PURE__ */ l("div", { className: "min-w-0", children: /* @__PURE__ */ l("div", { className: "truncate", title: i, children: i }) })
|
|
27
|
-
] }),
|
|
28
|
-
/* @__PURE__ */ o(h, { className: "flex-shrink-0 ml-3", children: [
|
|
29
|
-
/* @__PURE__ */ l(
|
|
30
|
-
p,
|
|
31
|
-
{
|
|
32
|
-
className: "px-0",
|
|
33
|
-
type: "link",
|
|
34
|
-
onClick: () => x(e.propertyValue),
|
|
35
|
-
children: c ? "暂停" : "播放"
|
|
36
|
-
}
|
|
37
|
-
),
|
|
38
|
-
/* @__PURE__ */ l(
|
|
39
|
-
p,
|
|
40
|
-
{
|
|
41
|
-
className: "px-0",
|
|
42
|
-
type: "link",
|
|
43
|
-
onClick: () => {
|
|
44
|
-
const r = document.createElement("a");
|
|
45
|
-
r.href = e.propertyValue, r.download = i, r.click();
|
|
46
|
-
},
|
|
47
|
-
children: "下载"
|
|
48
|
-
}
|
|
49
|
-
)
|
|
50
|
-
] })
|
|
51
|
-
] }, t);
|
|
52
|
-
})
|
|
53
|
-
}
|
|
1
|
+
import { jsx as o, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { Row as i, Col as p } from "antd";
|
|
3
|
+
const d = ({ properties: t, excludedKeys: l = [] }) => {
|
|
4
|
+
const s = t.filter(
|
|
5
|
+
(e) => !l.includes(e.propertyKey)
|
|
54
6
|
);
|
|
7
|
+
return /* @__PURE__ */ o(i, { className: "property-section-wraper", children: s.map((e, a) => /* @__PURE__ */ r(p, { span: 24, className: "section-item", children: [
|
|
8
|
+
/* @__PURE__ */ r("div", { className: "detail-label", children: [
|
|
9
|
+
e.propertyKey,
|
|
10
|
+
":"
|
|
11
|
+
] }),
|
|
12
|
+
/* @__PURE__ */ r("div", { className: "detail-value", children: [
|
|
13
|
+
" ",
|
|
14
|
+
e.propertyValue,
|
|
15
|
+
" "
|
|
16
|
+
] })
|
|
17
|
+
] }, a)) });
|
|
55
18
|
};
|
|
56
19
|
export {
|
|
57
|
-
|
|
20
|
+
d as default
|
|
58
21
|
};
|
package/lib/index.es44.js
CHANGED
|
@@ -1,33 +1,43 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
import { jsx as s, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { Space as d, Button as i } from "antd";
|
|
3
|
+
import { downloadFile as x } from "./index.es12.js";
|
|
4
|
+
const w = ({ documents: l, forceSingleColumn: c = !1, source: r }) => {
|
|
5
|
+
const a = (e) => e.toLowerCase().endsWith(".pdf") ? /* @__PURE__ */ s("span", { className: "w-24px h-30px i-custom-pdf-doc inline-block" }) : e.toLowerCase().endsWith(".docx") || e.toLowerCase().endsWith(".doc") ? /* @__PURE__ */ s("span", { className: "w-24px h-30px i-custom-doc-doc inline-block" }) : e.toLowerCase().endsWith(".pptx") || e.toLowerCase().endsWith(".ppt") ? /* @__PURE__ */ s("span", { className: "w-24px h-30px i-custom-ppt-doc inline-block" }) : e.toLowerCase().endsWith(".txt") ? /* @__PURE__ */ s("span", { className: "w-24px h-30px i-custom-txt-doc inline-block" }) : e.toLowerCase().endsWith(".csv") ? /* @__PURE__ */ s("span", { className: "w-24px h-30px i-custom-csv-doc inline-block" }) : e.toLowerCase().endsWith(".xls") || e.toLowerCase().endsWith(".xlsx") ? /* @__PURE__ */ s("span", { className: "w-24px h-30px i-custom-xls-doc inline-block" }) : /* @__PURE__ */ s("span", { className: "w-24px h-30px i-custom-else-doc inline-block" }), p = (e) => {
|
|
6
|
+
const n = e.split("/");
|
|
7
|
+
return n[n.length - 1];
|
|
8
|
+
};
|
|
9
|
+
return /* @__PURE__ */ s("div", { className: r === "qa-card" ? "grid grid-cols-1" : `grid ${c ? "grid-cols-1 gap-y-5" : "grid-cols-1 md:grid-cols-2 gap-x-100px gap-y-10px"}`, children: l.map((e, n) => {
|
|
10
|
+
const t = p(e.propertyValue);
|
|
11
|
+
return /* @__PURE__ */ o("div", { className: "flex items-center justify-between transition-all", children: [
|
|
12
|
+
/* @__PURE__ */ o("div", { className: "flex items-center min-w-0 flex-1", children: [
|
|
13
|
+
/* @__PURE__ */ s("div", { className: "mr-3 text-xl flex-shrink-0", children: a(t) }),
|
|
14
|
+
/* @__PURE__ */ s("div", { className: "min-w-0", children: /* @__PURE__ */ s("div", { className: "truncate", title: decodeURIComponent(t), children: decodeURIComponent(t) }) })
|
|
15
|
+
] }),
|
|
16
|
+
/* @__PURE__ */ o(d, { className: "flex-shrink-0", children: [
|
|
17
|
+
/* @__PURE__ */ s(
|
|
18
|
+
i,
|
|
19
|
+
{
|
|
20
|
+
className: "px-0px",
|
|
21
|
+
type: "link",
|
|
22
|
+
onClick: () => window.open(e.propertyValue, "_blank"),
|
|
23
|
+
children: "查看"
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ s(
|
|
27
|
+
i,
|
|
28
|
+
{
|
|
29
|
+
type: "link",
|
|
30
|
+
className: "px-0px",
|
|
31
|
+
onClick: () => {
|
|
32
|
+
x(e.propertyValue, t);
|
|
33
|
+
},
|
|
34
|
+
children: "下载"
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
] })
|
|
38
|
+
] }, n);
|
|
39
|
+
}) });
|
|
30
40
|
};
|
|
31
41
|
export {
|
|
32
|
-
|
|
42
|
+
w as default
|
|
33
43
|
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as l, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as g, useRef as y } from "react";
|
|
3
|
+
import { Row as d, Flex as h, Button as p } from "antd";
|
|
4
|
+
const j = ({ audios: m, forceSingleColumn: u = !1, source: f = "" }) => {
|
|
5
|
+
const [s, a] = g(null), n = y({}), x = (e) => {
|
|
6
|
+
var t, i;
|
|
7
|
+
if (s === e)
|
|
8
|
+
(t = n.current[e]) == null || t.pause(), a(null);
|
|
9
|
+
else {
|
|
10
|
+
if (s && ((i = n.current[s]) == null || i.pause()), a(e), !n.current[e]) {
|
|
11
|
+
const c = new Audio(e);
|
|
12
|
+
n.current[e] = c;
|
|
13
|
+
}
|
|
14
|
+
n.current[e].play(), n.current[e].onended = () => a(null);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
return /* @__PURE__ */ l(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
className: f === "qa-card" ? "grid grid-cols-1" : `grid ${u ? "grid-cols-1 gap-y-3" : "grid-cols-2 gap-x-100px gap-y-20px"}`,
|
|
21
|
+
children: m.map((e, t) => {
|
|
22
|
+
const i = e.propertyValue.split("/").pop() || "未命名音频", c = s === e.propertyValue;
|
|
23
|
+
return /* @__PURE__ */ o(d, { className: "flex items-center justify-between transition-all", justify: "space-between", align: "middle", children: [
|
|
24
|
+
/* @__PURE__ */ o(d, { className: "flex items-center min-w-0 flex-1", align: "middle", children: [
|
|
25
|
+
/* @__PURE__ */ l("div", { className: "mr-3 text-xl flex-shrink-0", children: /* @__PURE__ */ l("span", { className: "w-24px h-30px i-custom-audio inline-block" }) }),
|
|
26
|
+
/* @__PURE__ */ l("div", { className: "min-w-0", children: /* @__PURE__ */ l("div", { className: "truncate", title: i, children: i }) })
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ o(h, { className: "flex-shrink-0 ml-3", children: [
|
|
29
|
+
/* @__PURE__ */ l(
|
|
30
|
+
p,
|
|
31
|
+
{
|
|
32
|
+
className: "px-0",
|
|
33
|
+
type: "link",
|
|
34
|
+
onClick: () => x(e.propertyValue),
|
|
35
|
+
children: c ? "暂停" : "播放"
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ l(
|
|
39
|
+
p,
|
|
40
|
+
{
|
|
41
|
+
className: "px-0",
|
|
42
|
+
type: "link",
|
|
43
|
+
onClick: () => {
|
|
44
|
+
const r = document.createElement("a");
|
|
45
|
+
r.href = e.propertyValue, r.download = i, r.click();
|
|
46
|
+
},
|
|
47
|
+
children: "下载"
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
] })
|
|
51
|
+
] }, t);
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
j as default
|
|
58
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useEffect as w } from "react";
|
|
3
|
+
import h from "./index.es50.js";
|
|
4
|
+
const k = ({ relations: t, kgIds: s, viewMode: a = "list", source: c = "" }) => {
|
|
5
|
+
const [d, l] = m(t);
|
|
6
|
+
w(() => {
|
|
7
|
+
t && t && l(p(t || []));
|
|
8
|
+
}, [t]);
|
|
9
|
+
const p = (e) => e.map((o) => {
|
|
10
|
+
var r;
|
|
11
|
+
const n = (r = o.content) == null ? void 0 : r.filter((f) => f.propertyKey !== "id");
|
|
12
|
+
return {
|
|
13
|
+
...o,
|
|
14
|
+
showContent: n.slice(0, 8)
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
return /* @__PURE__ */ i("div", { className: "relation-section-wraper", children: d.map((e, u) => /* @__PURE__ */ i(
|
|
18
|
+
h,
|
|
19
|
+
{
|
|
20
|
+
entity: e,
|
|
21
|
+
viewMode: a,
|
|
22
|
+
className: "shadow-none",
|
|
23
|
+
source: c,
|
|
24
|
+
onViewDetails: (o) => {
|
|
25
|
+
const n = encodeURIComponent(e.uri);
|
|
26
|
+
window.open(`#/ai-search/fulltext-detail?uri=${n}&kgId=${s}&keyword=${o.showValue}`, "_blank");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
)) });
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
k as default
|
|
33
|
+
};
|