@hybridcore/ui 1.5.17 → 1.5.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.
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as i } from "react";
|
|
3
|
+
import s from "lodash";
|
|
4
|
+
import n from "./variable.js";
|
|
5
|
+
const c = ({
|
|
6
|
+
template: r,
|
|
7
|
+
data: t
|
|
8
|
+
}) => {
|
|
9
|
+
const a = i(() => {
|
|
10
|
+
let e = /* @__PURE__ */ new Map();
|
|
11
|
+
return r.properties.forEach((o) => {
|
|
12
|
+
const p = `${r.type}-${r.templateKey}-${o.propertyId}`;
|
|
13
|
+
e.set(p, o.name);
|
|
14
|
+
}), e;
|
|
15
|
+
}, [r]);
|
|
16
|
+
return s.keys(t.variables).map((e, o) => /* @__PURE__ */ m(
|
|
17
|
+
n,
|
|
18
|
+
{
|
|
19
|
+
type: e,
|
|
20
|
+
data: s.get(t.variables, e),
|
|
21
|
+
propertyNames: a,
|
|
22
|
+
hashPrefix: `${t.template.type}-${t.template.templateKey}-`
|
|
23
|
+
},
|
|
24
|
+
o
|
|
25
|
+
));
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
c as InstanceVariableList
|
|
29
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { styled as a, Box as e, Typography as o } from "@mui/material";
|
|
2
|
+
const i = a(e, {
|
|
3
|
+
name: "SNVariable",
|
|
4
|
+
slot: "root"
|
|
5
|
+
})({
|
|
6
|
+
width: "100%"
|
|
7
|
+
}), r = a(e, {
|
|
8
|
+
name: "SNVariable",
|
|
9
|
+
slot: "row"
|
|
10
|
+
})({
|
|
11
|
+
display: "flex"
|
|
12
|
+
}), n = a(o, {
|
|
13
|
+
name: "SNVariable",
|
|
14
|
+
slot: "title"
|
|
15
|
+
})(({ theme: l }) => ({
|
|
16
|
+
flex: 2,
|
|
17
|
+
lineHeight: 1.43,
|
|
18
|
+
paddingRight: l.spacing(0.5),
|
|
19
|
+
fontSize: 12
|
|
20
|
+
})), s = a(o, {
|
|
21
|
+
name: "SNVariable",
|
|
22
|
+
slot: "value"
|
|
23
|
+
})(() => ({
|
|
24
|
+
flex: 3,
|
|
25
|
+
wordBreak: "break-word",
|
|
26
|
+
fontSize: 12
|
|
27
|
+
}));
|
|
28
|
+
export {
|
|
29
|
+
i as VariableRoot,
|
|
30
|
+
r as VariableRow,
|
|
31
|
+
n as VariableTitle,
|
|
32
|
+
s as VariableValue
|
|
33
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as o, Fragment as g, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import { Box as a } from "@mui/material";
|
|
3
|
+
import m from "lodash";
|
|
4
|
+
import x from "dayjs";
|
|
5
|
+
import { VariableRoot as V, VariableRow as Y, VariableTitle as h, VariableValue as d } from "./styled.js";
|
|
6
|
+
const j = [
|
|
7
|
+
"string",
|
|
8
|
+
"boolean",
|
|
9
|
+
"date",
|
|
10
|
+
"byte",
|
|
11
|
+
"double",
|
|
12
|
+
"integer",
|
|
13
|
+
"long",
|
|
14
|
+
"enum",
|
|
15
|
+
"list",
|
|
16
|
+
"text",
|
|
17
|
+
"composite-list"
|
|
18
|
+
], i = ({ title: r, value: e }) => /* @__PURE__ */ v(Y, { children: [
|
|
19
|
+
/* @__PURE__ */ o(h, { 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 }), D = ({ title: r, value: e }) => /* @__PURE__ */ o(i, { title: r, value: e ? "Yes" : "No" }), T = ({ title: r, value: e }) => {
|
|
22
|
+
const u = x(e).format("DD/MM/YYYY");
|
|
23
|
+
return /* @__PURE__ */ o(i, { title: r, value: u });
|
|
24
|
+
}, c = ({ title: r, value: e }) => {
|
|
25
|
+
const u = e.join(", ");
|
|
26
|
+
return /* @__PURE__ */ o(i, { title: r, value: u });
|
|
27
|
+
};
|
|
28
|
+
function P({
|
|
29
|
+
type: r,
|
|
30
|
+
data: e,
|
|
31
|
+
filter: u,
|
|
32
|
+
propertyNames: b,
|
|
33
|
+
hashPrefix: f
|
|
34
|
+
}) {
|
|
35
|
+
return r === "geometry" ? /* @__PURE__ */ o(g, {}) : /* @__PURE__ */ o(V, { children: m.keys(e).filter(
|
|
36
|
+
(l) => u === void 0 || u === "" || l.includes(u)
|
|
37
|
+
).map((l, t) => {
|
|
38
|
+
const n = b.get(f + l);
|
|
39
|
+
return j.includes(r) ? /* @__PURE__ */ v(a, { mb: 1, className: "variable", children: [
|
|
40
|
+
r === "string" && /* @__PURE__ */ o(s, { title: n, value: e[l] }),
|
|
41
|
+
r === "boolean" && /* @__PURE__ */ o(D, { title: n, value: e[l] }),
|
|
42
|
+
r === "date" && /* @__PURE__ */ o(T, { title: n, value: e[l] }),
|
|
43
|
+
r === "byte" && /* @__PURE__ */ o(s, { title: n, value: e[l] }),
|
|
44
|
+
r === "double" && /* @__PURE__ */ o(s, { title: n, value: e[l] }),
|
|
45
|
+
r === "integer" && /* @__PURE__ */ o(s, { title: n, value: e[l] }),
|
|
46
|
+
r === "long" && /* @__PURE__ */ o(s, { title: n, value: e[l] }),
|
|
47
|
+
r === "enum" && /* @__PURE__ */ o(s, { title: n, value: e[l] }),
|
|
48
|
+
r === "list" && /* @__PURE__ */ o(c, { title: n, value: e[l] }),
|
|
49
|
+
r === "text" && /* @__PURE__ */ o(s, { title: n, value: e[l] }),
|
|
50
|
+
r === "composite-list" && /* @__PURE__ */ o(c, { title: n, value: e[l] })
|
|
51
|
+
] }, t) : /* @__PURE__ */ o(a, {}, t);
|
|
52
|
+
}) });
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
P as default
|
|
56
|
+
};
|
package/dist/main.d.ts
CHANGED
|
@@ -1504,6 +1504,12 @@ declare namespace INSTANCE {
|
|
|
1504
1504
|
interface UpdateTextAnnotationDTO extends CreateTextAnnotationDTO {
|
|
1505
1505
|
id: number;
|
|
1506
1506
|
}
|
|
1507
|
+
|
|
1508
|
+
type InstanceType =
|
|
1509
|
+
| INSTANCE.Object
|
|
1510
|
+
| INSTANCE.Event
|
|
1511
|
+
| INSTANCE.File
|
|
1512
|
+
| INSTANCE.Agent;
|
|
1507
1513
|
}
|
|
1508
1514
|
|
|
1509
1515
|
declare namespace ONTOLOGY {
|