@hybridcore/ui 1.5.20 → 1.5.22
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.
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as m } from "react";
|
|
3
3
|
import s from "lodash";
|
|
4
4
|
import n from "./variable.js";
|
|
5
5
|
const c = ({
|
|
6
6
|
template: r,
|
|
7
7
|
data: t
|
|
8
8
|
}) => {
|
|
9
|
-
const
|
|
9
|
+
const p = m(() => {
|
|
10
10
|
let e = /* @__PURE__ */ new Map();
|
|
11
11
|
return r.properties.forEach((o) => {
|
|
12
|
-
const
|
|
13
|
-
e.set(
|
|
12
|
+
const a = `${r.type}-${r.templateKey}-${o.propertyId}`;
|
|
13
|
+
e.set(a, o);
|
|
14
14
|
}), e;
|
|
15
15
|
}, [r]);
|
|
16
|
-
return s.keys(t.variables).map((e, o) => /* @__PURE__ */
|
|
16
|
+
return s.keys(t.variables).map((e, o) => /* @__PURE__ */ i(
|
|
17
17
|
n,
|
|
18
18
|
{
|
|
19
19
|
type: e,
|
|
20
20
|
data: s.get(t.variables, e),
|
|
21
|
-
|
|
21
|
+
properties: p,
|
|
22
22
|
hashPrefix: `${t.template.type}-${t.template.templateKey}-`
|
|
23
23
|
},
|
|
24
24
|
o
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as o, Fragment as
|
|
2
|
-
import { Box as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { VariableRoot as
|
|
6
|
-
const
|
|
1
|
+
import { jsx as o, Fragment as m, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { Box as b } from "@mui/material";
|
|
3
|
+
import V from "lodash";
|
|
4
|
+
import Y from "dayjs";
|
|
5
|
+
import { VariableRoot as x, VariableRow as d, VariableTitle as j, VariableValue as D } from "./styled.js";
|
|
6
|
+
const T = [
|
|
7
7
|
"string",
|
|
8
8
|
"boolean",
|
|
9
9
|
"date",
|
|
@@ -15,42 +15,43 @@ const j = [
|
|
|
15
15
|
"list",
|
|
16
16
|
"text",
|
|
17
17
|
"composite-list"
|
|
18
|
-
], i = ({ title: r, value: e }) => /* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */ o(
|
|
20
|
-
/* @__PURE__ */ o(
|
|
21
|
-
] }), s = ({ title: r, value: e }) => /* @__PURE__ */ o(i, { title: r, value: e }),
|
|
22
|
-
const u =
|
|
18
|
+
], i = ({ title: r, value: e }) => /* @__PURE__ */ g(d, { children: [
|
|
19
|
+
/* @__PURE__ */ o(j, { variant: "subtitle2", children: r }),
|
|
20
|
+
/* @__PURE__ */ o(D, { variant: "body2", children: e })
|
|
21
|
+
] }), s = ({ title: r, value: e }) => /* @__PURE__ */ o(i, { title: r, value: e }), h = ({ title: r, value: e }) => /* @__PURE__ */ o(i, { title: r, value: e ? "Yes" : "No" }), B = ({ title: r, value: e }) => {
|
|
22
|
+
const u = Y(e).format("DD/MM/YYYY");
|
|
23
23
|
return /* @__PURE__ */ o(i, { title: r, value: u });
|
|
24
|
-
},
|
|
24
|
+
}, f = ({ title: r, value: e }) => {
|
|
25
25
|
const u = (e ?? []).join(", ");
|
|
26
26
|
return /* @__PURE__ */ o(i, { title: r, value: u });
|
|
27
27
|
};
|
|
28
|
-
function
|
|
28
|
+
function _({
|
|
29
29
|
type: r,
|
|
30
30
|
data: e,
|
|
31
31
|
filter: u,
|
|
32
|
-
|
|
33
|
-
hashPrefix:
|
|
32
|
+
properties: a,
|
|
33
|
+
hashPrefix: c
|
|
34
34
|
}) {
|
|
35
|
-
return r === "geometry" ? /* @__PURE__ */ o(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
r === "
|
|
42
|
-
r === "
|
|
43
|
-
r === "
|
|
44
|
-
r === "
|
|
45
|
-
r === "
|
|
46
|
-
r === "
|
|
47
|
-
r === "
|
|
48
|
-
r === "
|
|
49
|
-
r === "
|
|
50
|
-
r === "
|
|
51
|
-
|
|
35
|
+
return r === "geometry" ? /* @__PURE__ */ o(m, {}) : /* @__PURE__ */ o(x, { children: V.keys(e).filter((n) => {
|
|
36
|
+
const t = a.get(c + n);
|
|
37
|
+
return !!(t && t.visible || u === void 0 || u === "" || n.includes(u));
|
|
38
|
+
}).map((n, t) => {
|
|
39
|
+
const v = a.get(c + n), l = v ? v.name : "";
|
|
40
|
+
return T.includes(r) ? /* @__PURE__ */ g(b, { mb: 1, className: "variable", children: [
|
|
41
|
+
r === "string" && /* @__PURE__ */ o(s, { title: l, value: e[n] }),
|
|
42
|
+
r === "boolean" && /* @__PURE__ */ o(h, { title: l, value: e[n] }),
|
|
43
|
+
r === "date" && /* @__PURE__ */ o(B, { title: l, value: e[n] }),
|
|
44
|
+
r === "byte" && /* @__PURE__ */ o(s, { title: l, value: e[n] }),
|
|
45
|
+
r === "double" && /* @__PURE__ */ o(s, { title: l, value: e[n] }),
|
|
46
|
+
r === "integer" && /* @__PURE__ */ o(s, { title: l, value: e[n] }),
|
|
47
|
+
r === "long" && /* @__PURE__ */ o(s, { title: l, value: e[n] }),
|
|
48
|
+
r === "enum" && /* @__PURE__ */ o(s, { title: l, value: e[n] }),
|
|
49
|
+
r === "list" && /* @__PURE__ */ o(f, { title: l, value: e[n] }),
|
|
50
|
+
r === "text" && /* @__PURE__ */ o(s, { title: l, value: e[n] }),
|
|
51
|
+
r === "composite-list" && /* @__PURE__ */ o(f, { title: l, value: e[n] })
|
|
52
|
+
] }, t) : /* @__PURE__ */ o(b, {}, t);
|
|
52
53
|
}) });
|
|
53
54
|
}
|
|
54
55
|
export {
|
|
55
|
-
|
|
56
|
+
_ as default
|
|
56
57
|
};
|
package/dist/main.d.ts
CHANGED
|
@@ -427,7 +427,7 @@ declare interface InstanceTableProps {
|
|
|
427
427
|
|
|
428
428
|
export declare const InstanceVariableList: FC<InstanceVariableListProps>;
|
|
429
429
|
|
|
430
|
-
declare interface InstanceVariableListProps {
|
|
430
|
+
export declare interface InstanceVariableListProps {
|
|
431
431
|
template: ONTOLOGY.TemplateType;
|
|
432
432
|
data: INSTANCE.InstanceType;
|
|
433
433
|
}
|