@hybridcore/ui 1.5.58 → 1.5.59
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,39 +1,39 @@
|
|
|
1
1
|
import { jsxs as n, Fragment as C, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import a from "react";
|
|
3
2
|
import { AddPhotoAlternate as I, Delete as W, Search as j, CheckBox as E, CloudUpload as P, Add as _ } from "@mui/icons-material";
|
|
4
3
|
import { IconButton as S, Dialog as N, DialogContent as O, Box as u, TextField as q, InputAdornment as z, Button as d, DialogActions as G } from "@mui/material";
|
|
5
|
-
import
|
|
4
|
+
import s from "react";
|
|
6
5
|
import H from "../../../../hooks/useToggle.js";
|
|
7
6
|
import { Tabs as J } from "../../../tabs/index.js";
|
|
7
|
+
import i from "./styled.js";
|
|
8
8
|
function Z({
|
|
9
|
-
value:
|
|
9
|
+
value: p,
|
|
10
10
|
list: A,
|
|
11
11
|
newIcon: o,
|
|
12
12
|
loading: m,
|
|
13
13
|
onChange: f,
|
|
14
14
|
onFileUpload: y
|
|
15
15
|
}) {
|
|
16
|
-
const { state: b, action: g } = H(!1), [x, k] =
|
|
17
|
-
|
|
16
|
+
const { state: b, action: g } = H(!1), [x, k] = s.useState(""), [l, r] = s.useState(null), [h, B] = s.useState();
|
|
17
|
+
s.useEffect(() => (o && r(o), () => {
|
|
18
18
|
}), [o]);
|
|
19
19
|
const F = (t) => {
|
|
20
20
|
k(t.target.value);
|
|
21
21
|
}, U = (t) => () => {
|
|
22
22
|
r(t);
|
|
23
23
|
}, v = () => {
|
|
24
|
-
l && (f(l),
|
|
24
|
+
l && (f(l), c());
|
|
25
25
|
}, D = () => {
|
|
26
26
|
r(null), f("");
|
|
27
|
-
},
|
|
27
|
+
}, c = () => {
|
|
28
28
|
g.close(), r(null);
|
|
29
29
|
}, R = (t) => {
|
|
30
30
|
t.target.files && B(t.target.files[0]);
|
|
31
31
|
}, T = () => {
|
|
32
|
-
|
|
32
|
+
h && (y(h.name), c());
|
|
33
33
|
};
|
|
34
34
|
return /* @__PURE__ */ n(C, { children: [
|
|
35
35
|
/* @__PURE__ */ n(i.Container, { children: [
|
|
36
|
-
|
|
36
|
+
p ? /* @__PURE__ */ e(i.Img, { src: p }) : /* @__PURE__ */ e(I, { color: "action" }),
|
|
37
37
|
/* @__PURE__ */ n(i.Actions, { children: [
|
|
38
38
|
/* @__PURE__ */ e(
|
|
39
39
|
S,
|
|
@@ -44,7 +44,7 @@ function Z({
|
|
|
44
44
|
children: /* @__PURE__ */ e(I, {})
|
|
45
45
|
}
|
|
46
46
|
),
|
|
47
|
-
!!
|
|
47
|
+
!!p && /* @__PURE__ */ e(
|
|
48
48
|
S,
|
|
49
49
|
{
|
|
50
50
|
title: "Remove Icon",
|
|
@@ -59,7 +59,7 @@ function Z({
|
|
|
59
59
|
N,
|
|
60
60
|
{
|
|
61
61
|
open: b.isOpen,
|
|
62
|
-
onClose:
|
|
62
|
+
onClose: c,
|
|
63
63
|
maxWidth: "sm",
|
|
64
64
|
fullWidth: !0,
|
|
65
65
|
scroll: "paper",
|
|
@@ -85,15 +85,15 @@ function Z({
|
|
|
85
85
|
}
|
|
86
86
|
),
|
|
87
87
|
A.filter((t) => {
|
|
88
|
-
const
|
|
89
|
-
return !(
|
|
88
|
+
const a = t.split("/ontology-icon/");
|
|
89
|
+
return !(a[1] && a[1].includes("/"));
|
|
90
90
|
}).filter((t) => {
|
|
91
91
|
if (x) {
|
|
92
92
|
if (t.search(new RegExp(x, "i")) !== -1)
|
|
93
93
|
return !0;
|
|
94
94
|
} else return !0;
|
|
95
95
|
return !1;
|
|
96
|
-
}).map((t,
|
|
96
|
+
}).map((t, a) => /* @__PURE__ */ n(
|
|
97
97
|
i.SelectButton,
|
|
98
98
|
{
|
|
99
99
|
variant: l === t ? "outlined" : "text",
|
|
@@ -104,7 +104,7 @@ function Z({
|
|
|
104
104
|
l === t ? /* @__PURE__ */ e(E, {}) : null
|
|
105
105
|
]
|
|
106
106
|
},
|
|
107
|
-
|
|
107
|
+
a
|
|
108
108
|
))
|
|
109
109
|
] })
|
|
110
110
|
},
|
|
@@ -150,7 +150,7 @@ function Z({
|
|
|
150
150
|
variant: "contained",
|
|
151
151
|
color: "primary",
|
|
152
152
|
startIcon: /* @__PURE__ */ e(P, {}),
|
|
153
|
-
disabled: m ||
|
|
153
|
+
disabled: m || h === null,
|
|
154
154
|
children: m ? "Uploading..." : "Upload!"
|
|
155
155
|
}
|
|
156
156
|
)
|
|
@@ -163,7 +163,7 @@ function Z({
|
|
|
163
163
|
}
|
|
164
164
|
) }),
|
|
165
165
|
/* @__PURE__ */ n(G, { style: { padding: "5px 15px 15px 15px" }, children: [
|
|
166
|
-
/* @__PURE__ */ e(d, { onClick:
|
|
166
|
+
/* @__PURE__ */ e(d, { onClick: c, variant: "contained", children: "Cancel" }),
|
|
167
167
|
/* @__PURE__ */ e(
|
|
168
168
|
d,
|
|
169
169
|
{
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as u, jsx as n } from "react/jsx-runtime";
|
|
2
|
-
import f from "react";
|
|
3
2
|
import k from "lodash";
|
|
3
|
+
import f from "react";
|
|
4
4
|
import { useForm as P, Controller as l } from "react-hook-form";
|
|
5
|
-
import O from "./components/
|
|
6
|
-
import j from "./components/
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { CatalogueInstanceSelector as O } from "./components/catalogue-instance-selector/index.js";
|
|
6
|
+
import j from "./components/property-list/index.js";
|
|
7
|
+
import K from "./components/recognition-property-list/index.js";
|
|
8
|
+
import { FormLabel as L, Button as b } from "@mui/material";
|
|
9
|
+
import { getNestedChildrenFromMap as _ } from "../../utils/ontology.js";
|
|
10
|
+
import { TreeSelect as w } from "../tree-select/index.js";
|
|
11
11
|
import A from "./components/select-icon/index.js";
|
|
12
12
|
import { T as m } from "../../TextField-CdKnj6de.js";
|
|
13
13
|
import { F as g } from "../../property-list-form-D77cAJ24.js";
|
|
@@ -21,10 +21,10 @@ function B(e, x) {
|
|
|
21
21
|
control: i,
|
|
22
22
|
formState: { errors: v },
|
|
23
23
|
getValues: h,
|
|
24
|
-
reset:
|
|
24
|
+
reset: V
|
|
25
25
|
} = P({
|
|
26
26
|
defaultValues: e.defaultValues
|
|
27
|
-
}), [
|
|
27
|
+
}), [C, F] = f.useState([]), I = (t) => {
|
|
28
28
|
const a = new Map(t);
|
|
29
29
|
for (const [r, o] of a)
|
|
30
30
|
a.set(r, {
|
|
@@ -33,7 +33,7 @@ function B(e, x) {
|
|
|
33
33
|
value: o.templateKey,
|
|
34
34
|
checked: h("parent") === o.templateKey
|
|
35
35
|
});
|
|
36
|
-
return
|
|
36
|
+
return _(a, !1);
|
|
37
37
|
}, S = () => {
|
|
38
38
|
const t = I(e.mappedTemplates);
|
|
39
39
|
F(t);
|
|
@@ -45,7 +45,7 @@ function B(e, x) {
|
|
|
45
45
|
};
|
|
46
46
|
return f.useImperativeHandle(x, () => ({
|
|
47
47
|
resetForm() {
|
|
48
|
-
|
|
48
|
+
V();
|
|
49
49
|
}
|
|
50
50
|
})), f.useEffect(() => (S(), () => {
|
|
51
51
|
}), [e.mappedTemplates]), /* @__PURE__ */ u("form", { onSubmit: (t, a) => {
|
|
@@ -118,11 +118,11 @@ function B(e, x) {
|
|
|
118
118
|
);
|
|
119
119
|
}
|
|
120
120
|
return /* @__PURE__ */ n(
|
|
121
|
-
|
|
121
|
+
w,
|
|
122
122
|
{
|
|
123
123
|
label: "Parent",
|
|
124
124
|
idKey: "templateKey",
|
|
125
|
-
data:
|
|
125
|
+
data: C,
|
|
126
126
|
selected: t ? [t] : "",
|
|
127
127
|
onChange: (r, o) => {
|
|
128
128
|
a({
|
|
@@ -142,7 +142,7 @@ function B(e, x) {
|
|
|
142
142
|
name: "agentReferenceIds",
|
|
143
143
|
control: i,
|
|
144
144
|
render: ({ field: { onChange: t } }) => /* @__PURE__ */ n(
|
|
145
|
-
|
|
145
|
+
O,
|
|
146
146
|
{
|
|
147
147
|
templates: e.agentTemplates ?? /* @__PURE__ */ new Map(),
|
|
148
148
|
data: e.agentsData,
|
|
@@ -243,7 +243,7 @@ function B(e, x) {
|
|
|
243
243
|
)
|
|
244
244
|
] }),
|
|
245
245
|
/* @__PURE__ */ u(g, { children: [
|
|
246
|
-
/* @__PURE__ */ n(
|
|
246
|
+
/* @__PURE__ */ n(L, { children: "Icon" }),
|
|
247
247
|
/* @__PURE__ */ n(
|
|
248
248
|
l,
|
|
249
249
|
{
|
|
@@ -255,8 +255,7 @@ function B(e, x) {
|
|
|
255
255
|
list: [],
|
|
256
256
|
value: t ?? "",
|
|
257
257
|
newIcon: "",
|
|
258
|
-
onFileUpload:
|
|
259
|
-
},
|
|
258
|
+
onFileUpload: a,
|
|
260
259
|
onChange: a
|
|
261
260
|
}
|
|
262
261
|
)
|
|
@@ -269,7 +268,7 @@ function B(e, x) {
|
|
|
269
268
|
name: "properties",
|
|
270
269
|
control: i,
|
|
271
270
|
render: ({ field: { value: t, onChange: a } }) => /* @__PURE__ */ n(
|
|
272
|
-
|
|
271
|
+
j,
|
|
273
272
|
{
|
|
274
273
|
list: t || [],
|
|
275
274
|
inputVariant: e.inputVariant,
|
|
@@ -286,7 +285,7 @@ function B(e, x) {
|
|
|
286
285
|
name: "recognitionPropertyList",
|
|
287
286
|
control: i,
|
|
288
287
|
render: ({ field: { value: t, onChange: a } }) => /* @__PURE__ */ n(
|
|
289
|
-
|
|
288
|
+
K,
|
|
290
289
|
{
|
|
291
290
|
list: t || [],
|
|
292
291
|
getFormValues: h,
|