@hybridcore/ui 1.4.2 → 1.4.3
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/dist/components/template-form/index.js +10 -10
- package/dist/main.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as t, jsxs as u } from "react/jsx-runtime";
|
|
2
2
|
import f from "react";
|
|
3
|
-
import
|
|
3
|
+
import k from "lodash";
|
|
4
4
|
import { useForm as P, Controller as l } from "react-hook-form";
|
|
5
5
|
import O from "./components/property-list/index.js";
|
|
6
6
|
import j from "./components/recognition-property-list/index.js";
|
|
@@ -14,7 +14,7 @@ import { T as m } from "../../TextField-D87qTh1k.js";
|
|
|
14
14
|
import { F as g } from "../../property-list-form-BfP9gzSo.js";
|
|
15
15
|
import { F as d } from "../../FormControlLabel-D9KFjcIx.js";
|
|
16
16
|
import { C as c } from "../../Checkbox-qy3cjvnb.js";
|
|
17
|
-
import { B as
|
|
17
|
+
import { B as y } from "../../Box-BPyg-Ybm.js";
|
|
18
18
|
function D(e, x) {
|
|
19
19
|
const {
|
|
20
20
|
register: s,
|
|
@@ -38,7 +38,7 @@ function D(e, x) {
|
|
|
38
38
|
}, S = () => {
|
|
39
39
|
const n = I(e.mappedTemplates);
|
|
40
40
|
F(n);
|
|
41
|
-
},
|
|
41
|
+
}, M = () => {
|
|
42
42
|
if (e.onCancel) {
|
|
43
43
|
e.onCancel();
|
|
44
44
|
return;
|
|
@@ -50,8 +50,8 @@ function D(e, x) {
|
|
|
50
50
|
}
|
|
51
51
|
})), f.useEffect(() => (S(), () => {
|
|
52
52
|
}), [e.mappedTemplates]), /* @__PURE__ */ t(_, { disableHeader: !0, children: /* @__PURE__ */ u("form", { onSubmit: (n, a) => {
|
|
53
|
-
n == null || n.preventDefault(), T(((o) => (
|
|
54
|
-
e.onSubmit(
|
|
53
|
+
n == null || n.preventDefault(), T(((o) => (p) => {
|
|
54
|
+
e.onSubmit(p, o);
|
|
55
55
|
})(a))();
|
|
56
56
|
}, children: [
|
|
57
57
|
/* @__PURE__ */ t(
|
|
@@ -145,7 +145,7 @@ function D(e, x) {
|
|
|
145
145
|
render: ({ field: { onChange: n } }) => /* @__PURE__ */ t(
|
|
146
146
|
K,
|
|
147
147
|
{
|
|
148
|
-
templates: e.agentTemplates,
|
|
148
|
+
templates: e.agentTemplates ?? /* @__PURE__ */ new Map(),
|
|
149
149
|
data: e.agentsData,
|
|
150
150
|
inputVariant: e.inputVariant,
|
|
151
151
|
selectedInstances: e.selectedAgentInstances,
|
|
@@ -274,7 +274,7 @@ function D(e, x) {
|
|
|
274
274
|
{
|
|
275
275
|
list: n || [],
|
|
276
276
|
inputVariant: e.inputVariant,
|
|
277
|
-
templateId:
|
|
277
|
+
templateId: k.get(e.defaultValues, "id"),
|
|
278
278
|
disablePropertyId: e.disablePropertyId,
|
|
279
279
|
onChange: a
|
|
280
280
|
}
|
|
@@ -296,7 +296,7 @@ function D(e, x) {
|
|
|
296
296
|
)
|
|
297
297
|
}
|
|
298
298
|
),
|
|
299
|
-
/* @__PURE__ */ u(
|
|
299
|
+
/* @__PURE__ */ u(y, { display: "flex", justifyContent: "space-between", mt: 3, children: [
|
|
300
300
|
/* @__PURE__ */ t(
|
|
301
301
|
b,
|
|
302
302
|
{
|
|
@@ -304,11 +304,11 @@ function D(e, x) {
|
|
|
304
304
|
variant: "text",
|
|
305
305
|
disabled: e.loading,
|
|
306
306
|
sx: { textTransform: "none" },
|
|
307
|
-
onClick:
|
|
307
|
+
onClick: M,
|
|
308
308
|
children: "Cancel"
|
|
309
309
|
}
|
|
310
310
|
),
|
|
311
|
-
/* @__PURE__ */ t(
|
|
311
|
+
/* @__PURE__ */ t(y, { children: e.saveButtons ? e.saveButtons.map((n, a) => /* @__PURE__ */ t(
|
|
312
312
|
b,
|
|
313
313
|
{
|
|
314
314
|
type: "submit",
|
package/dist/main.d.ts
CHANGED
|
@@ -772,8 +772,8 @@ K extends
|
|
|
772
772
|
ONTOLOGY.UpdateFileDTO &
|
|
773
773
|
ONTOLOGY.UpdateAgentDTO
|
|
774
774
|
>;
|
|
775
|
-
loading
|
|
776
|
-
agentTemplates
|
|
775
|
+
loading?: boolean;
|
|
776
|
+
agentTemplates?: Map<string | number, ONTOLOGY.Agent>;
|
|
777
777
|
agentsData?: FV.HierarchySearchResults;
|
|
778
778
|
selectedAgentInstances?: INSTANCE.Agent[];
|
|
779
779
|
inputVariant?: "standard" | "outlined" | "filled";
|