@hybridcore/ui 1.5.85 → 1.5.87
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,43 +1,43 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Box as
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Box as r, Skeleton as t, Typography as l } from "@mui/material";
|
|
3
3
|
import { AlternateCardRoot as b, AlternateCardMenuContainer as v } from "./styled.js";
|
|
4
|
-
const
|
|
5
|
-
title:
|
|
6
|
-
subTitle:
|
|
7
|
-
text:
|
|
8
|
-
avatar:
|
|
9
|
-
footer:
|
|
10
|
-
menu:
|
|
11
|
-
extra:
|
|
4
|
+
const y = ({
|
|
5
|
+
title: p,
|
|
6
|
+
subTitle: d,
|
|
7
|
+
text: o,
|
|
8
|
+
avatar: h,
|
|
9
|
+
footer: c,
|
|
10
|
+
menu: s,
|
|
11
|
+
extra: w,
|
|
12
12
|
loading: i,
|
|
13
|
-
rightMenu:
|
|
14
|
-
onClick:
|
|
13
|
+
rightMenu: x,
|
|
14
|
+
onClick: a
|
|
15
15
|
}) => {
|
|
16
|
-
const
|
|
17
|
-
|
|
16
|
+
const m = () => {
|
|
17
|
+
a && a();
|
|
18
18
|
};
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ n(
|
|
20
20
|
b,
|
|
21
21
|
{
|
|
22
22
|
sx: {
|
|
23
23
|
display: "flex"
|
|
24
24
|
},
|
|
25
25
|
children: [
|
|
26
|
-
/* @__PURE__ */ r
|
|
27
|
-
|
|
28
|
-
/* @__PURE__ */ r
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
/* @__PURE__ */ n(r, { flex: 1, children: [
|
|
27
|
+
s && /* @__PURE__ */ e(v, { className: "menu-container", children: s }),
|
|
28
|
+
/* @__PURE__ */ n(r, { display: "flex", alignItems: "center", children: [
|
|
29
|
+
h && /* @__PURE__ */ e(r, { mr: 2, children: i ? /* @__PURE__ */ e(
|
|
30
|
+
t,
|
|
31
31
|
{
|
|
32
32
|
animation: "wave",
|
|
33
33
|
variant: "circular",
|
|
34
34
|
width: 42,
|
|
35
35
|
height: 42
|
|
36
36
|
}
|
|
37
|
-
) :
|
|
38
|
-
/* @__PURE__ */ r
|
|
37
|
+
) : h }),
|
|
38
|
+
/* @__PURE__ */ n(r, { width: "100%", sx: { minWidth: 0 }, children: [
|
|
39
39
|
i ? /* @__PURE__ */ e(
|
|
40
|
-
|
|
40
|
+
t,
|
|
41
41
|
{
|
|
42
42
|
animation: "wave",
|
|
43
43
|
height: 10,
|
|
@@ -45,7 +45,7 @@ const g = ({
|
|
|
45
45
|
sx: { mb: 0.25, mt: 0.35 }
|
|
46
46
|
}
|
|
47
47
|
) : /* @__PURE__ */ e(
|
|
48
|
-
|
|
48
|
+
l,
|
|
49
49
|
{
|
|
50
50
|
gutterBottom: !0,
|
|
51
51
|
variant: "subtitle1",
|
|
@@ -57,15 +57,17 @@ const g = ({
|
|
|
57
57
|
display: "-webkit-box",
|
|
58
58
|
WebkitLineClamp: 3,
|
|
59
59
|
WebkitBoxOrient: "vertical",
|
|
60
|
-
cursor:
|
|
61
|
-
lineHeight: "22px"
|
|
60
|
+
cursor: a ? "pointer" : "default",
|
|
61
|
+
lineHeight: "22px",
|
|
62
|
+
overflowWrap: "break-word",
|
|
63
|
+
wordBreak: "break-word"
|
|
62
64
|
},
|
|
63
|
-
onClick:
|
|
64
|
-
children:
|
|
65
|
+
onClick: m,
|
|
66
|
+
children: p
|
|
65
67
|
}
|
|
66
68
|
),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
d && (i ? /* @__PURE__ */ e(
|
|
70
|
+
t,
|
|
69
71
|
{
|
|
70
72
|
animation: "wave",
|
|
71
73
|
height: 10,
|
|
@@ -73,7 +75,7 @@ const g = ({
|
|
|
73
75
|
sx: { mb: 0.25, mt: 0.35 }
|
|
74
76
|
}
|
|
75
77
|
) : /* @__PURE__ */ e(
|
|
76
|
-
|
|
78
|
+
l,
|
|
77
79
|
{
|
|
78
80
|
variant: "caption",
|
|
79
81
|
component: "p",
|
|
@@ -84,17 +86,19 @@ const g = ({
|
|
|
84
86
|
display: "-webkit-box",
|
|
85
87
|
WebkitLineClamp: 4,
|
|
86
88
|
WebkitBoxOrient: "vertical",
|
|
87
|
-
lineHeight: "16px"
|
|
89
|
+
lineHeight: "16px",
|
|
90
|
+
overflowWrap: "break-word",
|
|
91
|
+
wordBreak: "break-word"
|
|
88
92
|
},
|
|
89
|
-
children:
|
|
93
|
+
children: d
|
|
90
94
|
}
|
|
91
95
|
))
|
|
92
96
|
] })
|
|
93
97
|
] }),
|
|
94
|
-
i ? /* @__PURE__ */ r
|
|
95
|
-
/* @__PURE__ */ e(
|
|
98
|
+
i ? /* @__PURE__ */ n(r, { children: [
|
|
99
|
+
/* @__PURE__ */ e(t, { animation: "wave", height: 10, sx: { mb: 0.5, mt: 0.5 } }),
|
|
96
100
|
/* @__PURE__ */ e(
|
|
97
|
-
|
|
101
|
+
t,
|
|
98
102
|
{
|
|
99
103
|
animation: "wave",
|
|
100
104
|
height: 10,
|
|
@@ -103,7 +107,7 @@ const g = ({
|
|
|
103
107
|
}
|
|
104
108
|
)
|
|
105
109
|
] }) : /* @__PURE__ */ e(
|
|
106
|
-
|
|
110
|
+
l,
|
|
107
111
|
{
|
|
108
112
|
variant: "caption",
|
|
109
113
|
component: "p",
|
|
@@ -115,29 +119,31 @@ const g = ({
|
|
|
115
119
|
WebkitLineClamp: 4,
|
|
116
120
|
WebkitBoxOrient: "vertical",
|
|
117
121
|
lineHeight: "16px",
|
|
118
|
-
cursor:
|
|
119
|
-
my: 2
|
|
122
|
+
cursor: a ? "pointer" : "default",
|
|
123
|
+
my: 2,
|
|
124
|
+
overflowWrap: "break-word",
|
|
125
|
+
wordBreak: "break-word"
|
|
120
126
|
},
|
|
121
|
-
onClick:
|
|
122
|
-
children: /* @__PURE__ */ e("small", { children: typeof
|
|
127
|
+
onClick: m,
|
|
128
|
+
children: /* @__PURE__ */ e("small", { children: typeof o == "string" ? o.length > 350 ? `${o.substring(0, 350)}...` : o : null })
|
|
123
129
|
}
|
|
124
130
|
),
|
|
125
131
|
i ? /* @__PURE__ */ e(
|
|
126
|
-
|
|
132
|
+
t,
|
|
127
133
|
{
|
|
128
134
|
animation: "wave",
|
|
129
135
|
height: 10,
|
|
130
136
|
width: "100px",
|
|
131
137
|
sx: { mb: 1, mt: 1 }
|
|
132
138
|
}
|
|
133
|
-
) :
|
|
134
|
-
i ? null :
|
|
139
|
+
) : c,
|
|
140
|
+
i ? null : w
|
|
135
141
|
] }),
|
|
136
|
-
/* @__PURE__ */ e(
|
|
142
|
+
/* @__PURE__ */ e(r, { children: x })
|
|
137
143
|
]
|
|
138
144
|
}
|
|
139
145
|
);
|
|
140
146
|
};
|
|
141
147
|
export {
|
|
142
|
-
|
|
148
|
+
y as CardAlternate
|
|
143
149
|
};
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { styled as
|
|
2
|
-
const r =
|
|
1
|
+
import { styled as i, Card as t, Box as n } from "@mui/material";
|
|
2
|
+
const r = i(t, {
|
|
3
3
|
name: "SNAlternateCard",
|
|
4
4
|
// The component name
|
|
5
5
|
slot: "root"
|
|
6
6
|
// The slot name
|
|
7
|
-
})(({ theme:
|
|
7
|
+
})(({ theme: a }) => ({
|
|
8
8
|
position: "relative",
|
|
9
9
|
display: "flex",
|
|
10
|
-
padding:
|
|
11
|
-
|
|
10
|
+
padding: a.spacing(3),
|
|
11
|
+
paddingTop: a.spacing(6),
|
|
12
|
+
gap: a.spacing(2),
|
|
12
13
|
"& .MuiCardMedia-root": {
|
|
13
|
-
borderRadius:
|
|
14
|
+
borderRadius: a.shape.borderRadius
|
|
14
15
|
},
|
|
15
16
|
"& .MuiCardContent-root, & .MuiCardContent-root:last-child": {
|
|
16
17
|
display: "flex",
|
|
17
18
|
flex: 1,
|
|
18
|
-
gap:
|
|
19
|
+
gap: a.spacing(3),
|
|
19
20
|
padding: 0,
|
|
20
21
|
margin: 0
|
|
21
22
|
},
|
|
@@ -23,7 +24,7 @@ const r = a(t, {
|
|
|
23
24
|
visibility: "visible",
|
|
24
25
|
opacity: 1
|
|
25
26
|
}
|
|
26
|
-
})), e =
|
|
27
|
+
})), e = i(n, {
|
|
27
28
|
name: "SNAlternateCard",
|
|
28
29
|
slot: "menuContainer"
|
|
29
30
|
})(() => ({
|
|
@@ -31,6 +32,9 @@ const r = a(t, {
|
|
|
31
32
|
top: 8,
|
|
32
33
|
right: 8,
|
|
33
34
|
display: "flex",
|
|
35
|
+
flexWrap: "wrap",
|
|
36
|
+
gap: 8,
|
|
37
|
+
alignItems: "center",
|
|
34
38
|
visibility: "hidden",
|
|
35
39
|
opacity: 0,
|
|
36
40
|
transition: "0.3s all"
|
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as m } from "react";
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
3
2
|
import s from "lodash";
|
|
4
|
-
import n from "
|
|
5
|
-
|
|
3
|
+
import { useMemo as n } from "react";
|
|
4
|
+
import h from "./variable.js";
|
|
5
|
+
const $ = ({
|
|
6
6
|
template: r,
|
|
7
|
-
data: t
|
|
7
|
+
data: t,
|
|
8
|
+
fieldOptions: p
|
|
8
9
|
}) => {
|
|
9
|
-
const
|
|
10
|
+
const a = n(() => {
|
|
10
11
|
let e = /* @__PURE__ */ new Map();
|
|
11
12
|
return r.properties.forEach((o) => {
|
|
12
|
-
const
|
|
13
|
-
e.set(
|
|
13
|
+
const i = `${r.type}-${r.templateKey}-${o.propertyId}`;
|
|
14
|
+
e.set(i, o);
|
|
14
15
|
}), e;
|
|
15
16
|
}, [r]);
|
|
16
|
-
return s.keys(t.variables).map((e, o) => /* @__PURE__ */
|
|
17
|
-
|
|
17
|
+
return s.keys(t.variables).map((e, o) => /* @__PURE__ */ m(
|
|
18
|
+
h,
|
|
18
19
|
{
|
|
19
20
|
type: e,
|
|
20
21
|
data: s.get(t.variables, e),
|
|
21
|
-
properties:
|
|
22
|
-
hashPrefix: `${t.template.type}-${t.template.templateKey}
|
|
22
|
+
properties: a,
|
|
23
|
+
hashPrefix: `${t.template.type}-${t.template.templateKey}-`,
|
|
24
|
+
fieldOptions: p
|
|
23
25
|
},
|
|
24
26
|
o
|
|
25
27
|
));
|
|
26
28
|
};
|
|
27
29
|
export {
|
|
28
|
-
|
|
30
|
+
$ as InstanceVariableList
|
|
29
31
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Box as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { VariableRoot as
|
|
6
|
-
const
|
|
1
|
+
import { jsx as a, Fragment as x, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { Box as i } from "@mui/material";
|
|
3
|
+
import V from "dayjs";
|
|
4
|
+
import Y from "lodash";
|
|
5
|
+
import { VariableRoot as v, VariableRow as g, VariableTitle as h, VariableValue as f } from "./styled.js";
|
|
6
|
+
const T = [
|
|
7
7
|
"string",
|
|
8
8
|
"boolean",
|
|
9
9
|
"date",
|
|
@@ -15,44 +15,69 @@ const D = [
|
|
|
15
15
|
"list",
|
|
16
16
|
"text",
|
|
17
17
|
"composite-list"
|
|
18
|
-
],
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
] }),
|
|
22
|
-
const
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
},
|
|
25
|
-
const
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
}, E = ({ title:
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
18
|
+
], b = ({ title: e, value: r }) => /* @__PURE__ */ m(g, { children: [
|
|
19
|
+
/* @__PURE__ */ a(h, { variant: "subtitle2", children: e }),
|
|
20
|
+
/* @__PURE__ */ a(f, { variant: "body2", children: r })
|
|
21
|
+
] }), j = ({ title: e, value: r }) => /* @__PURE__ */ a(b, { title: e, value: r }), D = ({ title: e, value: r }) => /* @__PURE__ */ a(b, { title: e, value: r ? "Yes" : "No" }), k = ({ title: e, value: r }) => {
|
|
22
|
+
const n = V(r).format("DD/MM/YYYY");
|
|
23
|
+
return /* @__PURE__ */ a(b, { title: e, value: n });
|
|
24
|
+
}, B = ({ title: e, value: r }) => {
|
|
25
|
+
const n = (r ?? []).join(", ");
|
|
26
|
+
return /* @__PURE__ */ a(b, { title: e, value: n });
|
|
27
|
+
}, E = ({ title: e, value: r }) => /* @__PURE__ */ m(g, { children: [
|
|
28
|
+
/* @__PURE__ */ a(h, { variant: "subtitle2", children: e }),
|
|
29
|
+
/* @__PURE__ */ a(f, { variant: "body2", children: /* @__PURE__ */ a("a", { href: r, target: "_blank", rel: "noopener noreferrer", children: r }) })
|
|
30
30
|
] });
|
|
31
|
+
function _(e, r, n, t) {
|
|
32
|
+
if (t != null && t.component) return t.component;
|
|
33
|
+
if (t != null && t.clickable) return /* @__PURE__ */ a(E, { title: n, value: r });
|
|
34
|
+
switch (e) {
|
|
35
|
+
case "string":
|
|
36
|
+
case "byte":
|
|
37
|
+
case "double":
|
|
38
|
+
case "integer":
|
|
39
|
+
case "long":
|
|
40
|
+
case "enum":
|
|
41
|
+
case "text":
|
|
42
|
+
return /* @__PURE__ */ a(j, { title: n, value: r });
|
|
43
|
+
case "boolean":
|
|
44
|
+
return /* @__PURE__ */ a(D, { title: n, value: r });
|
|
45
|
+
case "date":
|
|
46
|
+
return /* @__PURE__ */ a(k, { title: n, value: r });
|
|
47
|
+
case "list":
|
|
48
|
+
case "composite-list":
|
|
49
|
+
return /* @__PURE__ */ a(B, { title: n, value: r });
|
|
50
|
+
default:
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
31
54
|
function R({
|
|
32
|
-
type:
|
|
33
|
-
data:
|
|
34
|
-
filter:
|
|
35
|
-
properties:
|
|
36
|
-
hashPrefix:
|
|
55
|
+
type: e,
|
|
56
|
+
data: r,
|
|
57
|
+
filter: n,
|
|
58
|
+
properties: t,
|
|
59
|
+
hashPrefix: d,
|
|
60
|
+
fieldOptions: s
|
|
37
61
|
}) {
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
62
|
+
return e === "geometry" ? /* @__PURE__ */ a(x, {}) : /* @__PURE__ */ a(v, { children: Y.keys(r).filter((l) => {
|
|
63
|
+
var o;
|
|
64
|
+
const u = t.get(d + l);
|
|
65
|
+
return u && !u.visible || (o = s == null ? void 0 : s[l]) != null && o.hidden ? !1 : n === void 0 || n === "" || l.includes(n);
|
|
66
|
+
}).map((l, u) => {
|
|
67
|
+
const o = t.get(d + l), y = o ? o.name : "", c = s == null ? void 0 : s[l];
|
|
68
|
+
return T.includes(e) ? /* @__PURE__ */ m(
|
|
69
|
+
i,
|
|
70
|
+
{
|
|
71
|
+
mb: 1,
|
|
72
|
+
className: "variable",
|
|
73
|
+
...(c == null ? void 0 : c.order) && { order: c.order },
|
|
74
|
+
children: [
|
|
75
|
+
_(e, r[l], y, c),
|
|
76
|
+
c == null ? void 0 : c.helperText
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
u
|
|
80
|
+
) : /* @__PURE__ */ a(i, {}, u);
|
|
56
81
|
}) });
|
|
57
82
|
}
|
|
58
83
|
export {
|
package/dist/main.d.ts
CHANGED
|
@@ -283,6 +283,7 @@ declare interface FieldOptions {
|
|
|
283
283
|
order?: number;
|
|
284
284
|
hidden?: boolean;
|
|
285
285
|
disabled?: boolean;
|
|
286
|
+
clickable?: boolean;
|
|
286
287
|
minDate?: Dayjs;
|
|
287
288
|
helperText?: React.ReactNode;
|
|
288
289
|
placeholder?: string;
|
|
@@ -551,6 +552,9 @@ export declare const InstanceVariableList: FC<InstanceVariableListProps>;
|
|
|
551
552
|
export declare interface InstanceVariableListProps {
|
|
552
553
|
template: ONTOLOGY.TemplateType;
|
|
553
554
|
data: INSTANCE.InstanceType;
|
|
555
|
+
fieldOptions?: {
|
|
556
|
+
[key: string]: FieldOptions;
|
|
557
|
+
};
|
|
554
558
|
}
|
|
555
559
|
|
|
556
560
|
declare interface ItemProps {
|