@hybridcore/ui 1.6.23 → 1.6.24
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/instance-form/components/composite-list/index.js +1 -1
- package/dist/components/instance-form/components/variable/index.js +1 -1
- package/dist/components/instance-form/components/variables/index.js +25 -23
- package/dist/components/instance-form/index.js +41 -39
- package/dist/components/instance-form/logic.js +41 -40
- package/dist/components/instance-variable-list/variable.js +14 -12
- package/dist/components/property-mapping/index.js +1 -1
- package/dist/components/template-form/components/property-list/property-list-columns.js +36 -29
- package/dist/components/template-form/components/property-list/property-list-form.js +332 -269
- package/dist/components/template-property-filters/index.js +25 -25
- package/dist/components/template-property-filters/logic.js +12 -10
- package/dist/constants/index.js +1 -0
- package/dist/{index-BtlzPygz.js → index-BQ4_OA4b.js} +103 -101
- package/dist/main.d.ts +14 -3
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ import "../../../conditional-wrapper/index.js";
|
|
|
9
9
|
import "../../helpers.js";
|
|
10
10
|
import "../../styled.js";
|
|
11
11
|
import "../TopLabelWrapper.js";
|
|
12
|
-
import { C as b } from "../../../../index-
|
|
12
|
+
import { C as b } from "../../../../index-BQ4_OA4b.js";
|
|
13
13
|
export {
|
|
14
14
|
b as CompositeList
|
|
15
15
|
};
|
|
@@ -9,7 +9,7 @@ import "../../../geometry-picker/index.js";
|
|
|
9
9
|
import "../../../phone-input/index.js";
|
|
10
10
|
import "../../helpers.js";
|
|
11
11
|
import "../../styled.js";
|
|
12
|
-
import { V as d } from "../../../../index-
|
|
12
|
+
import { V as d } from "../../../../index-BQ4_OA4b.js";
|
|
13
13
|
import "../composite-matrix/index.js";
|
|
14
14
|
import "../TopLabelWrapper.js";
|
|
15
15
|
export {
|
|
@@ -1,54 +1,56 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
1
|
+
import { jsx as s, jsxs as v } from "react/jsx-runtime";
|
|
2
2
|
import l from "lodash";
|
|
3
|
-
import
|
|
4
|
-
import { VariablesContainer as
|
|
5
|
-
import { V as
|
|
6
|
-
const
|
|
3
|
+
import x from "react";
|
|
4
|
+
import { VariablesContainer as y, FieldContainer as C } from "../../styled.js";
|
|
5
|
+
import { V as I } from "../../../../index-BQ4_OA4b.js";
|
|
6
|
+
const P = (d) => {
|
|
7
7
|
const {
|
|
8
8
|
template: n,
|
|
9
9
|
value: i,
|
|
10
10
|
mapboxAccessToken: u,
|
|
11
11
|
variant: p = "outlined",
|
|
12
12
|
labelPosition: c = "default",
|
|
13
|
-
fieldOptions:
|
|
13
|
+
fieldOptions: r,
|
|
14
|
+
mode: m = "create",
|
|
14
15
|
onChange: f
|
|
15
|
-
} = d,
|
|
16
|
-
const
|
|
16
|
+
} = d, b = x.useMemo(() => {
|
|
17
|
+
const e = (n == null ? void 0 : n.properties.filter((o) => o.visible)) ?? [], t = l.orderBy(e, "id");
|
|
17
18
|
return l.orderBy(
|
|
18
19
|
t,
|
|
19
20
|
(o) => {
|
|
20
21
|
var a;
|
|
21
|
-
return ((a =
|
|
22
|
+
return ((a = r == null ? void 0 : r[o.propertyId]) == null ? void 0 : a.order) ?? 0;
|
|
22
23
|
}
|
|
23
24
|
);
|
|
24
|
-
}, [n,
|
|
25
|
+
}, [n, r]), h = (e) => {
|
|
25
26
|
f({
|
|
26
|
-
target: { value: { ...i, ...
|
|
27
|
+
target: { value: { ...i, ...e } }
|
|
27
28
|
});
|
|
28
29
|
};
|
|
29
|
-
return n === void 0 ? null : /* @__PURE__ */ s(
|
|
30
|
+
return n === void 0 ? null : /* @__PURE__ */ s(y, { children: b.filter((e) => {
|
|
30
31
|
var t;
|
|
31
|
-
return
|
|
32
|
-
}).map((
|
|
32
|
+
return r ? !((t = r[e.propertyId]) != null && t.hidden) : !0;
|
|
33
|
+
}).map((e) => {
|
|
33
34
|
var o;
|
|
34
|
-
const t = i ? i[
|
|
35
|
-
return /* @__PURE__ */
|
|
35
|
+
const t = i ? i[e.propertyId] : "";
|
|
36
|
+
return /* @__PURE__ */ v(C, { children: [
|
|
36
37
|
/* @__PURE__ */ s(
|
|
37
|
-
|
|
38
|
+
I,
|
|
38
39
|
{
|
|
39
|
-
property:
|
|
40
|
+
property: e,
|
|
40
41
|
value: t,
|
|
41
42
|
mapboxAccessToken: u,
|
|
42
43
|
variant: p,
|
|
43
44
|
labelPosition: c,
|
|
44
|
-
fieldOptions:
|
|
45
|
-
|
|
45
|
+
fieldOptions: r,
|
|
46
|
+
mode: m,
|
|
47
|
+
onChange: h
|
|
46
48
|
}
|
|
47
49
|
),
|
|
48
|
-
|
|
49
|
-
] },
|
|
50
|
+
r && ((o = r[e.propertyId]) == null ? void 0 : o.helperText)
|
|
51
|
+
] }, e.propertyId);
|
|
50
52
|
}) });
|
|
51
53
|
};
|
|
52
54
|
export {
|
|
53
|
-
|
|
55
|
+
P as Variables
|
|
54
56
|
};
|
|
@@ -3,36 +3,37 @@ import { TextField as b, FormControlLabel as me, Checkbox as ue } from "@mui/mat
|
|
|
3
3
|
import pe from "react";
|
|
4
4
|
import { Controller as u } from "react-hook-form";
|
|
5
5
|
import { ConditionalWrapper as d } from "../conditional-wrapper/index.js";
|
|
6
|
-
import { Container as
|
|
7
|
-
import { DisseminationList as
|
|
8
|
-
import { SecurityLevel as
|
|
9
|
-
import { TreeSelect as
|
|
10
|
-
import { PolicyList as
|
|
6
|
+
import { Container as Re } from "../container/index.js";
|
|
7
|
+
import { DisseminationList as Pe } from "../data-security-selectors/dissemination-list/index.js";
|
|
8
|
+
import { SecurityLevel as ke } from "../data-security-selectors/security-level/index.js";
|
|
9
|
+
import { TreeSelect as We } from "../tree-select/index.js";
|
|
10
|
+
import { PolicyList as Ae } from "./components/policy-list/index.js";
|
|
11
11
|
import g from "./components/TopLabelWrapper.js";
|
|
12
|
-
import { Variables as
|
|
12
|
+
import { Variables as De } from "./components/variables/index.js";
|
|
13
13
|
import { leftLayoutWrapper as h } from "./helpers.js";
|
|
14
|
-
import { useInstanceFormLogic as
|
|
15
|
-
import { InstanceFormForm as
|
|
16
|
-
function
|
|
14
|
+
import { useInstanceFormLogic as Ee } from "./logic.js";
|
|
15
|
+
import { InstanceFormForm as qe, FieldContainer as p, CharCount as fe, TemplateGroup as Ue, SecurityLevelContainer as Ne, ActionsRow as $e, CancelButton as Ge, SaveButtonsContainer as _e, SaveButton as he, InstanceFormRoot as je, CONTAINER_SX as He } from "./styled.js";
|
|
16
|
+
function Xe(e, ve) {
|
|
17
17
|
var V, w, S, F, B, R, P, k, W, A, D, E, q, U, N, $, G, _, j, H, X, z, J, K, M, Q, Y, Z, ee, te, ie, ne, ae, le, re, de;
|
|
18
|
-
const { refs: T, state: be, form: Ce, actions: o } =
|
|
18
|
+
const { refs: T, state: be, form: Ce, actions: o } = Ee(e), {
|
|
19
19
|
ownerState: y,
|
|
20
20
|
templates: Oe,
|
|
21
21
|
selectedTemplate: xe,
|
|
22
22
|
disabledTemplates: Le,
|
|
23
23
|
labelPosition: n,
|
|
24
|
+
mode: ge,
|
|
24
25
|
loading: C,
|
|
25
|
-
hasPolicyList:
|
|
26
|
-
errors:
|
|
27
|
-
isDirty:
|
|
28
|
-
} = be, { register: I, handleSubmit:
|
|
26
|
+
hasPolicyList: Te,
|
|
27
|
+
errors: ye,
|
|
28
|
+
isDirty: Ie
|
|
29
|
+
} = be, { register: I, handleSubmit: Ve, control: m, getValues: we, setValue: O, reset: Se, watch: x } = Ce;
|
|
29
30
|
pe.useImperativeHandle(ve, () => ({
|
|
30
31
|
requestSubmit() {
|
|
31
32
|
var i;
|
|
32
33
|
(i = T.formRef.current) == null || i.requestSubmit();
|
|
33
34
|
},
|
|
34
35
|
resetForm() {
|
|
35
|
-
|
|
36
|
+
Se({
|
|
36
37
|
title: "",
|
|
37
38
|
description: "",
|
|
38
39
|
templateId: 0,
|
|
@@ -43,20 +44,20 @@ function He(e, ve) {
|
|
|
43
44
|
O(i, a);
|
|
44
45
|
},
|
|
45
46
|
getFormValue(i) {
|
|
46
|
-
return
|
|
47
|
+
return we(i);
|
|
47
48
|
},
|
|
48
49
|
isDirty() {
|
|
49
|
-
return
|
|
50
|
+
return Ie;
|
|
50
51
|
},
|
|
51
52
|
getWatchedValue(i) {
|
|
52
53
|
return x(i);
|
|
53
54
|
}
|
|
54
55
|
}));
|
|
55
|
-
const
|
|
56
|
-
|
|
56
|
+
const Fe = /* @__PURE__ */ s(
|
|
57
|
+
qe,
|
|
57
58
|
{
|
|
58
59
|
ref: T.formRef,
|
|
59
|
-
onSubmit:
|
|
60
|
+
onSubmit: Ve(e.onSubmit),
|
|
60
61
|
children: [
|
|
61
62
|
!((w = (V = e.fieldOptions) == null ? void 0 : V.title) != null && w.hidden) && /* @__PURE__ */ t(
|
|
62
63
|
d,
|
|
@@ -78,7 +79,7 @@ function He(e, ve) {
|
|
|
78
79
|
inputProps: o.maxCharValidation("title") ? { maxLength: o.maxCharValidation("title") } : void 0,
|
|
79
80
|
fullWidth: !0,
|
|
80
81
|
...I("title", { required: !0 }),
|
|
81
|
-
...
|
|
82
|
+
...ye.title && {
|
|
82
83
|
helperText: "This field is required!",
|
|
83
84
|
error: !0
|
|
84
85
|
}
|
|
@@ -131,7 +132,7 @@ function He(e, ve) {
|
|
|
131
132
|
{
|
|
132
133
|
condition: n === "left",
|
|
133
134
|
wrapper: h("Template"),
|
|
134
|
-
children: /* @__PURE__ */ s(
|
|
135
|
+
children: /* @__PURE__ */ s(Ue, { children: [
|
|
135
136
|
/* @__PURE__ */ t(
|
|
136
137
|
d,
|
|
137
138
|
{
|
|
@@ -161,7 +162,7 @@ function He(e, ve) {
|
|
|
161
162
|
);
|
|
162
163
|
}
|
|
163
164
|
return /* @__PURE__ */ t(
|
|
164
|
-
|
|
165
|
+
We,
|
|
165
166
|
{
|
|
166
167
|
label: n === "default" ? "Template" : void 0,
|
|
167
168
|
data: Oe,
|
|
@@ -221,7 +222,7 @@ function He(e, ve) {
|
|
|
221
222
|
}
|
|
222
223
|
}
|
|
223
224
|
),
|
|
224
|
-
|
|
225
|
+
Te && "appliedPolicies" in (e.values ?? {}) && !((K = (J = e.fieldOptions) == null ? void 0 : J.appliedPolicies) != null && K.hidden) && /* @__PURE__ */ t(
|
|
225
226
|
u,
|
|
226
227
|
{
|
|
227
228
|
name: "appliedPolicies",
|
|
@@ -235,7 +236,7 @@ function He(e, ve) {
|
|
|
235
236
|
wrapper: h("Policy List"),
|
|
236
237
|
children: /* @__PURE__ */ s(p, { children: [
|
|
237
238
|
/* @__PURE__ */ t(
|
|
238
|
-
|
|
239
|
+
Ae,
|
|
239
240
|
{
|
|
240
241
|
policyList: e.policyList ?? [],
|
|
241
242
|
labelPosition: n,
|
|
@@ -256,7 +257,7 @@ function He(e, ve) {
|
|
|
256
257
|
name: "variables",
|
|
257
258
|
control: m,
|
|
258
259
|
render: ({ field: { value: i, onChange: a } }) => /* @__PURE__ */ t(
|
|
259
|
-
|
|
260
|
+
De,
|
|
260
261
|
{
|
|
261
262
|
template: xe,
|
|
262
263
|
value: i,
|
|
@@ -264,6 +265,7 @@ function He(e, ve) {
|
|
|
264
265
|
variant: e.inputVariant,
|
|
265
266
|
labelPosition: n,
|
|
266
267
|
fieldOptions: e.fieldOptions,
|
|
268
|
+
mode: ge,
|
|
267
269
|
onChange: a
|
|
268
270
|
}
|
|
269
271
|
)
|
|
@@ -282,8 +284,8 @@ function He(e, ve) {
|
|
|
282
284
|
const f = new FileReader();
|
|
283
285
|
f.onload = (L) => {
|
|
284
286
|
var ce;
|
|
285
|
-
const
|
|
286
|
-
i(
|
|
287
|
+
const Be = ((ce = L.target) == null ? void 0 : ce.result).split("base64,")[1];
|
|
288
|
+
i(Be);
|
|
287
289
|
};
|
|
288
290
|
const v = l.target.files[0];
|
|
289
291
|
O("originalFileName", v.name), O("contentType", v.type), f.readAsDataURL(v);
|
|
@@ -374,7 +376,7 @@ function He(e, ve) {
|
|
|
374
376
|
a(f);
|
|
375
377
|
};
|
|
376
378
|
return /* @__PURE__ */ t(
|
|
377
|
-
|
|
379
|
+
Pe,
|
|
378
380
|
{
|
|
379
381
|
selectedIds: c,
|
|
380
382
|
memberedGroups: e.memberedGroups,
|
|
@@ -387,7 +389,7 @@ function He(e, ve) {
|
|
|
387
389
|
}
|
|
388
390
|
}
|
|
389
391
|
),
|
|
390
|
-
!((de = (re = e.fieldOptions) == null ? void 0 : re.securityLevelId) != null && de.hidden) && /* @__PURE__ */ t(
|
|
392
|
+
!((de = (re = e.fieldOptions) == null ? void 0 : re.securityLevelId) != null && de.hidden) && /* @__PURE__ */ t(Ne, { children: /* @__PURE__ */ t(
|
|
391
393
|
u,
|
|
392
394
|
{
|
|
393
395
|
name: "securityLevelId",
|
|
@@ -398,7 +400,7 @@ function He(e, ve) {
|
|
|
398
400
|
a(l);
|
|
399
401
|
};
|
|
400
402
|
return /* @__PURE__ */ t(
|
|
401
|
-
|
|
403
|
+
ke,
|
|
402
404
|
{
|
|
403
405
|
value: i || 0,
|
|
404
406
|
securityLevels: e.securityLevels,
|
|
@@ -411,9 +413,9 @@ function He(e, ve) {
|
|
|
411
413
|
}
|
|
412
414
|
}
|
|
413
415
|
) }),
|
|
414
|
-
/* @__PURE__ */ s(
|
|
416
|
+
/* @__PURE__ */ s($e, { children: [
|
|
415
417
|
e.onCancel && /* @__PURE__ */ t(
|
|
416
|
-
|
|
418
|
+
Ge,
|
|
417
419
|
{
|
|
418
420
|
color: "primary",
|
|
419
421
|
variant: "text",
|
|
@@ -422,7 +424,7 @@ function He(e, ve) {
|
|
|
422
424
|
children: "Cancel"
|
|
423
425
|
}
|
|
424
426
|
),
|
|
425
|
-
/* @__PURE__ */ t(
|
|
427
|
+
/* @__PURE__ */ t(_e, { ownerState: y, children: e.customSaveButtons ? e.customSaveButtons : e.saveButtons ? e.saveButtons.map((i, a) => /* @__PURE__ */ t(
|
|
426
428
|
he,
|
|
427
429
|
{
|
|
428
430
|
type: "submit",
|
|
@@ -448,16 +450,16 @@ function He(e, ve) {
|
|
|
448
450
|
]
|
|
449
451
|
}
|
|
450
452
|
);
|
|
451
|
-
return /* @__PURE__ */ t(
|
|
453
|
+
return /* @__PURE__ */ t(je, { ownerState: y, sx: e.sx, children: /* @__PURE__ */ t(
|
|
452
454
|
d,
|
|
453
455
|
{
|
|
454
456
|
condition: e.variant === void 0 || e.variant === "inline",
|
|
455
|
-
wrapper: (i) => /* @__PURE__ */ t(
|
|
456
|
-
children:
|
|
457
|
+
wrapper: (i) => /* @__PURE__ */ t(Re, { disableHeader: !0, sx: He, children: i }),
|
|
458
|
+
children: Fe
|
|
457
459
|
}
|
|
458
460
|
) });
|
|
459
461
|
}
|
|
460
|
-
const
|
|
462
|
+
const ot = pe.forwardRef(Xe);
|
|
461
463
|
export {
|
|
462
|
-
|
|
464
|
+
ot as InstanceForm
|
|
463
465
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { useThemeProps as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useForm as
|
|
5
|
-
import { getNestedChildrenFromMap as
|
|
6
|
-
const
|
|
1
|
+
import { useThemeProps as K } from "@mui/material";
|
|
2
|
+
import L from "lodash";
|
|
3
|
+
import o, { useRef as G } from "react";
|
|
4
|
+
import { useForm as U } from "react-hook-form";
|
|
5
|
+
import { getNestedChildrenFromMap as j } from "../../utils/ontology.js";
|
|
6
|
+
const B = (c) => window.crypto.subtle.importKey(
|
|
7
7
|
"jwk",
|
|
8
|
-
|
|
8
|
+
c,
|
|
9
9
|
{ name: "AES-GCM", length: 256 },
|
|
10
10
|
!0,
|
|
11
11
|
["encrypt", "decrypt"]
|
|
12
|
-
),
|
|
12
|
+
), H = async (c, e) => {
|
|
13
13
|
try {
|
|
14
|
-
const r = window.atob(e).split(":"), p = new Uint8Array(r[0].split(",").map(Number)), m = new Uint8Array(r[1].split(",").map(Number)).buffer, u = await crypto.subtle.decrypt({ name: "AES-GCM", iv: p },
|
|
14
|
+
const r = window.atob(e).split(":"), p = new Uint8Array(r[0].split(",").map(Number)), m = new Uint8Array(r[1].split(",").map(Number)).buffer, u = await crypto.subtle.decrypt({ name: "AES-GCM", iv: p }, c, m);
|
|
15
15
|
return { status: "SUCCESS", data: new TextDecoder().decode(u) };
|
|
16
16
|
} catch (r) {
|
|
17
17
|
return console.error(r), { status: "ERROR", message: "Decryption error" };
|
|
18
18
|
}
|
|
19
|
-
},
|
|
19
|
+
}, J = {
|
|
20
20
|
alg: "A256GCM",
|
|
21
21
|
ext: !0,
|
|
22
22
|
k: "_El6rHQxC5E7NdO5DiMDITjF7f65wrlaJmFVagVE9Ic",
|
|
23
23
|
key_ops: ["encrypt", "decrypt"],
|
|
24
24
|
kty: "oct"
|
|
25
|
-
},
|
|
26
|
-
const e =
|
|
25
|
+
}, z = (c) => {
|
|
26
|
+
const e = K({ props: c, name: "HCInstanceForm" }), r = G(null), p = U({ defaultValues: e.values }), {
|
|
27
27
|
register: m,
|
|
28
28
|
handleSubmit: u,
|
|
29
29
|
control: E,
|
|
@@ -32,54 +32,54 @@ const j = (l) => window.crypto.subtle.importKey(
|
|
|
32
32
|
setValue: f,
|
|
33
33
|
reset: N,
|
|
34
34
|
watch: V
|
|
35
|
-
} = p, h = (e == null ? void 0 : e.labelPosition) ?? "default", b = e.variant ?? "inline", v = e.loading ?? !1, C = !!e.onCancel, g = !!(e.policyList && e.policyList.length > 0), [
|
|
35
|
+
} = p, h = (e == null ? void 0 : e.labelPosition) ?? "default", b = e.variant ?? "inline", k = e.mode ?? "create", v = e.loading ?? !1, C = !!e.onCancel, g = !!(e.policyList && e.policyList.length > 0), [x, A] = o.useState([]), [l, S] = o.useState(), [, M] = o.useState(0), P = o.useMemo(() => {
|
|
36
36
|
const a = [];
|
|
37
37
|
return e.templates.forEach((t) => {
|
|
38
38
|
t.creatable || a.push(String(t.id));
|
|
39
39
|
}), a;
|
|
40
40
|
}, [e.templates]);
|
|
41
|
-
|
|
41
|
+
o.useEffect(() => {
|
|
42
42
|
(async () => {
|
|
43
43
|
if (!e.values) return;
|
|
44
44
|
const a = { ...e.values }, t = e.templates.get(a.templateId);
|
|
45
45
|
if (!t) return;
|
|
46
46
|
const n = t.properties.filter(
|
|
47
|
-
(
|
|
47
|
+
(s) => s.privacyPreservationMethod === "ENCRYPTION"
|
|
48
48
|
);
|
|
49
49
|
if (n.length !== 0)
|
|
50
|
-
for (const
|
|
51
|
-
const i =
|
|
50
|
+
for (const s of n) {
|
|
51
|
+
const i = L.get(a, `variables.${s.propertyId}`);
|
|
52
52
|
if (i && e.keyAuth) {
|
|
53
|
-
const
|
|
54
|
-
T.data && (f(`variables.${
|
|
53
|
+
const O = await B(J), T = await H(O, String(i));
|
|
54
|
+
T.data && (f(`variables.${s.propertyId}`, T.data), M((_) => _ + 1));
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
})();
|
|
58
58
|
}, [e.values, e.templates, e.keyAuth, f]);
|
|
59
|
-
const w =
|
|
59
|
+
const w = o.useCallback(() => {
|
|
60
60
|
const a = d("templateId");
|
|
61
|
-
|
|
62
|
-
const t =
|
|
63
|
-
|
|
61
|
+
l && S(void 0);
|
|
62
|
+
const t = j(e.templates);
|
|
63
|
+
A(t);
|
|
64
64
|
for (const n of e.templates.values())
|
|
65
65
|
if (n.id === a) {
|
|
66
66
|
S(n);
|
|
67
67
|
break;
|
|
68
68
|
}
|
|
69
|
-
}, [d, e.templates,
|
|
70
|
-
|
|
69
|
+
}, [d, e.templates, l]);
|
|
70
|
+
o.useEffect(() => {
|
|
71
71
|
w();
|
|
72
|
-
}, [e.templates]),
|
|
73
|
-
e.onSelectedTemplateChange && e.onSelectedTemplateChange(
|
|
74
|
-
}, [
|
|
75
|
-
const
|
|
72
|
+
}, [e.templates]), o.useEffect(() => {
|
|
73
|
+
e.onSelectedTemplateChange && e.onSelectedTemplateChange(l);
|
|
74
|
+
}, [l]);
|
|
75
|
+
const R = () => {
|
|
76
76
|
e.onCancel && e.onCancel(y);
|
|
77
|
-
},
|
|
78
|
-
var
|
|
77
|
+
}, F = (a) => {
|
|
78
|
+
var s, i;
|
|
79
79
|
if (!a) return;
|
|
80
|
-
const t = (i = (
|
|
80
|
+
const t = (i = (s = e == null ? void 0 : e.fieldOptions) == null ? void 0 : s[a]) == null ? void 0 : i.maxChar;
|
|
81
81
|
return t != null && !Number.isNaN(Number(t)) ? Number(t) : void 0;
|
|
82
|
-
},
|
|
82
|
+
}, D = {
|
|
83
83
|
variant: b,
|
|
84
84
|
inputVariant: e.inputVariant,
|
|
85
85
|
labelPosition: h,
|
|
@@ -90,12 +90,13 @@ const j = (l) => window.crypto.subtle.importKey(
|
|
|
90
90
|
return {
|
|
91
91
|
refs: { formRef: r },
|
|
92
92
|
state: {
|
|
93
|
-
ownerState:
|
|
94
|
-
templates:
|
|
95
|
-
selectedTemplate:
|
|
96
|
-
disabledTemplates:
|
|
93
|
+
ownerState: D,
|
|
94
|
+
templates: x,
|
|
95
|
+
selectedTemplate: l,
|
|
96
|
+
disabledTemplates: P,
|
|
97
97
|
labelPosition: h,
|
|
98
98
|
variant: b,
|
|
99
|
+
mode: k,
|
|
99
100
|
loading: v,
|
|
100
101
|
hasCancel: C,
|
|
101
102
|
hasPolicyList: g,
|
|
@@ -105,11 +106,11 @@ const j = (l) => window.crypto.subtle.importKey(
|
|
|
105
106
|
form: { register: m, handleSubmit: u, control: E, getValues: d, setValue: f, reset: N, watch: V },
|
|
106
107
|
actions: {
|
|
107
108
|
handleTemplates: w,
|
|
108
|
-
handleOnCancel:
|
|
109
|
-
maxCharValidation:
|
|
109
|
+
handleOnCancel: R,
|
|
110
|
+
maxCharValidation: F
|
|
110
111
|
}
|
|
111
112
|
};
|
|
112
113
|
};
|
|
113
114
|
export {
|
|
114
|
-
|
|
115
|
+
z as useInstanceFormLogic
|
|
115
116
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as a, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import { VariableRow as
|
|
4
|
-
const o = ({ title: n, value: r, sx: e }) => /* @__PURE__ */ l(
|
|
5
|
-
/* @__PURE__ */ a(
|
|
6
|
-
/* @__PURE__ */ a(
|
|
1
|
+
import { jsx as a, Fragment as i, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import h from "dayjs";
|
|
3
|
+
import { VariableRow as m, VariableTitle as u, VariableValue as b } from "./styled.js";
|
|
4
|
+
const o = ({ title: n, value: r, sx: e }) => /* @__PURE__ */ l(m, { sx: e, children: [
|
|
5
|
+
/* @__PURE__ */ a(u, { variant: "subtitle2", children: n }),
|
|
6
|
+
/* @__PURE__ */ a(b, { variant: "body2", children: r })
|
|
7
7
|
] }), s = ({ title: n, value: r, sx: e }) => /* @__PURE__ */ a(o, { title: n, value: r, sx: e }), g = ({
|
|
8
8
|
title: n,
|
|
9
9
|
value: r,
|
|
@@ -12,13 +12,13 @@ const o = ({ title: n, value: r, sx: e }) => /* @__PURE__ */ l(u, { sx: e, child
|
|
|
12
12
|
title: n,
|
|
13
13
|
value: r,
|
|
14
14
|
sx: e
|
|
15
|
-
}) => /* @__PURE__ */ a(o, { title: n, value:
|
|
15
|
+
}) => /* @__PURE__ */ a(o, { title: n, value: h(r).format("DD/MM/YYYY"), sx: e }), V = ({
|
|
16
16
|
title: n,
|
|
17
17
|
value: r,
|
|
18
18
|
sx: e
|
|
19
|
-
}) => /* @__PURE__ */ a(o, { title: n, value: (r ?? []).join(", "), sx: e }), Y = ({ title: n, value: r, sx: e }) => /* @__PURE__ */ l(
|
|
20
|
-
/* @__PURE__ */ a(
|
|
21
|
-
/* @__PURE__ */ a(
|
|
19
|
+
}) => /* @__PURE__ */ a(o, { title: n, value: (r ?? []).join(", "), sx: e }), Y = ({ title: n, value: r, sx: e }) => /* @__PURE__ */ l(m, { sx: e, children: [
|
|
20
|
+
/* @__PURE__ */ a(u, { variant: "subtitle2", children: n }),
|
|
21
|
+
/* @__PURE__ */ a(b, { variant: "body2", children: /* @__PURE__ */ a("a", { href: r, target: "_blank", rel: "noopener noreferrer", children: r }) })
|
|
22
22
|
] }), k = ({
|
|
23
23
|
type: n,
|
|
24
24
|
title: r,
|
|
@@ -27,8 +27,9 @@ const o = ({ title: n, value: r, sx: e }) => /* @__PURE__ */ l(u, { sx: e, child
|
|
|
27
27
|
fieldOptions: c
|
|
28
28
|
}) => {
|
|
29
29
|
if (n === "geometry") return null;
|
|
30
|
-
if (c != null && c.component) return /* @__PURE__ */ a(
|
|
31
|
-
if (c != null && c.clickable)
|
|
30
|
+
if (c != null && c.component) return /* @__PURE__ */ a(i, { children: c.component });
|
|
31
|
+
if (c != null && c.clickable)
|
|
32
|
+
return /* @__PURE__ */ a(Y, { title: r, value: e, sx: t });
|
|
32
33
|
switch (n) {
|
|
33
34
|
case "boolean":
|
|
34
35
|
return /* @__PURE__ */ a(g, { title: r, value: e, sx: t });
|
|
@@ -40,6 +41,7 @@ const o = ({ title: n, value: r, sx: e }) => /* @__PURE__ */ l(u, { sx: e, child
|
|
|
40
41
|
case "string":
|
|
41
42
|
case "byte":
|
|
42
43
|
case "double":
|
|
44
|
+
case "decimal":
|
|
43
45
|
case "integer":
|
|
44
46
|
case "long":
|
|
45
47
|
case "enum":
|
|
@@ -2,7 +2,7 @@ import { jsxs as a, jsx as e, Fragment as m } from "react/jsx-runtime";
|
|
|
2
2
|
import { CloseOutlined as W, ChevronRight as $, ErrorOutline as q, Refresh as J, Check as U } from "@mui/icons-material";
|
|
3
3
|
import { Button as N, IconButton as _, FormControl as O, Select as D, MenuItem as C, Typography as H } from "@mui/material";
|
|
4
4
|
import F from "lodash";
|
|
5
|
-
import { V as G } from "../../index-
|
|
5
|
+
import { V as G } from "../../index-BQ4_OA4b.js";
|
|
6
6
|
import { d as L } from "../../ol-yOE-NV0X.js";
|
|
7
7
|
import { RangeSelector as Q } from "../range-selector/index.js";
|
|
8
8
|
import { usePropertyMappingLogic as X } from "./logic.js";
|
|
@@ -1,33 +1,40 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { d as
|
|
3
|
-
import { T as
|
|
1
|
+
import { jsxs as r, jsx as o, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import { d as w, a as b } from "../../../../Delete-ofipLwkd.js";
|
|
3
|
+
import { T as d } from "../../../../Typography-B_LKrxyI.js";
|
|
4
4
|
import { I as s } from "../../../../IconButton-SJfF1cr9.js";
|
|
5
|
-
const
|
|
5
|
+
const I = (n) => [
|
|
6
6
|
{ field: "name", headerName: "Name", flex: 1 },
|
|
7
7
|
{ field: "propertyId", headerName: "Property ID", flex: 1 },
|
|
8
8
|
{
|
|
9
9
|
field: "type",
|
|
10
10
|
headerName: "Type",
|
|
11
11
|
width: 140,
|
|
12
|
-
renderCell: (
|
|
13
|
-
var
|
|
14
|
-
const { dataTypeInfo: e, defaultValue:
|
|
15
|
-
let
|
|
16
|
-
return e != null && e.datePattern && (
|
|
17
|
-
|
|
18
|
-
((
|
|
12
|
+
renderCell: (a) => {
|
|
13
|
+
var l, m, f, h, p;
|
|
14
|
+
const { dataTypeInfo: e, defaultValue: t } = a.row;
|
|
15
|
+
let i = a.value;
|
|
16
|
+
return e != null && e.datePattern && (i += ` ${e.datePattern}`), e != null && e.coordinateFormat && (i += ` ${e.coordinateFormat}`), e != null && e.enumValues && (i += ` ${e.enumValues.join(",")}`), (e == null ? void 0 : e.precision) !== void 0 && (i += ` (${e.precision},${e.scale ?? 0})`), t && (i += ` ${t}`), /* @__PURE__ */ r("div", { className: "MuiDataGrid-cellContent", title: i, children: [
|
|
17
|
+
a.value,
|
|
18
|
+
((l = a.row.dataTypeInfo) == null ? void 0 : l.datePattern) && /* @__PURE__ */ r(d, { variant: "caption", ml: 1, children: [
|
|
19
19
|
"(",
|
|
20
|
-
(m =
|
|
20
|
+
(m = a.row.dataTypeInfo) == null ? void 0 : m.datePattern,
|
|
21
21
|
")"
|
|
22
22
|
] }),
|
|
23
|
-
((f =
|
|
23
|
+
((f = a.row.dataTypeInfo) == null ? void 0 : f.coordinateFormat) && /* @__PURE__ */ r(d, { variant: "caption", ml: 1, children: [
|
|
24
24
|
"(",
|
|
25
|
-
(h =
|
|
25
|
+
(h = a.row.dataTypeInfo) == null ? void 0 : h.coordinateFormat,
|
|
26
26
|
")"
|
|
27
27
|
] }),
|
|
28
|
-
|
|
28
|
+
((p = a.row.dataTypeInfo) == null ? void 0 : p.precision) !== void 0 && /* @__PURE__ */ r(d, { variant: "caption", ml: 1, children: [
|
|
29
29
|
"(",
|
|
30
|
-
|
|
30
|
+
a.row.dataTypeInfo.precision,
|
|
31
|
+
",",
|
|
32
|
+
a.row.dataTypeInfo.scale ?? 0,
|
|
33
|
+
")"
|
|
34
|
+
] }),
|
|
35
|
+
a.row.defaultValue !== null && a.row.defaultValue !== "" && /* @__PURE__ */ r(d, { variant: "caption", ml: 1, children: [
|
|
36
|
+
"(",
|
|
37
|
+
a.row.defaultValue,
|
|
31
38
|
")"
|
|
32
39
|
] })
|
|
33
40
|
] });
|
|
@@ -37,14 +44,14 @@ const y = (d) => [
|
|
|
37
44
|
field: "inheritedFrom",
|
|
38
45
|
headerName: "Inherited From",
|
|
39
46
|
width: 120,
|
|
40
|
-
renderCell: (
|
|
41
|
-
var e,
|
|
47
|
+
renderCell: (a) => {
|
|
48
|
+
var e, t;
|
|
42
49
|
return /* @__PURE__ */ o(
|
|
43
50
|
"div",
|
|
44
51
|
{
|
|
45
52
|
className: "MuiDataGrid-cellContent",
|
|
46
|
-
title: (e =
|
|
47
|
-
children: ((
|
|
53
|
+
title: (e = a.value) == null ? void 0 : e.templateName,
|
|
54
|
+
children: ((t = a.value) == null ? void 0 : t.templateName) ?? "-"
|
|
48
55
|
}
|
|
49
56
|
);
|
|
50
57
|
}
|
|
@@ -97,23 +104,23 @@ const y = (d) => [
|
|
|
97
104
|
width: 120,
|
|
98
105
|
sortable: !1,
|
|
99
106
|
filterable: !1,
|
|
100
|
-
renderCell: (
|
|
101
|
-
const { inheritedFrom: e } =
|
|
102
|
-
return /* @__PURE__ */
|
|
107
|
+
renderCell: (a) => {
|
|
108
|
+
const { inheritedFrom: e } = a.row, t = !!(e != null && e.templateId) && e.templateId !== n.templateId;
|
|
109
|
+
return /* @__PURE__ */ r(c, { children: [
|
|
103
110
|
/* @__PURE__ */ o(
|
|
104
111
|
s,
|
|
105
112
|
{
|
|
106
113
|
size: "medium",
|
|
107
|
-
onClick: () =>
|
|
108
|
-
children: /* @__PURE__ */ o(
|
|
114
|
+
onClick: () => n.onEdit(a.row),
|
|
115
|
+
children: /* @__PURE__ */ o(w, { color: "primary" })
|
|
109
116
|
}
|
|
110
117
|
),
|
|
111
|
-
!
|
|
118
|
+
!t && /* @__PURE__ */ o(
|
|
112
119
|
s,
|
|
113
120
|
{
|
|
114
121
|
size: "medium",
|
|
115
|
-
onClick: () =>
|
|
116
|
-
children: /* @__PURE__ */ o(
|
|
122
|
+
onClick: () => n.onDelete(a.row),
|
|
123
|
+
children: /* @__PURE__ */ o(b, {})
|
|
117
124
|
}
|
|
118
125
|
)
|
|
119
126
|
] });
|
|
@@ -121,5 +128,5 @@ const y = (d) => [
|
|
|
121
128
|
}
|
|
122
129
|
];
|
|
123
130
|
export {
|
|
124
|
-
|
|
131
|
+
I as default
|
|
125
132
|
};
|