@hybridcore/ui 1.5.34 → 1.5.35
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/index.js +37 -34
- package/dist/main.d.ts +1 -0
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { getNestedChildrenFromMap as ve } from "../../utils/ontology.js";
|
|
|
6
6
|
import { i as ye, d as ge } from "../../utils-Bq0ye5vf.js";
|
|
7
7
|
import { ConditionalWrapper as u } from "../conditional-wrapper/index.js";
|
|
8
8
|
import { Container as Te } from "../container/index.js";
|
|
9
|
-
import { Box as n, Typography as b, TextField as g, FormGroup as xe, FormControlLabel as
|
|
9
|
+
import { Box as n, Typography as b, TextField as g, FormGroup as xe, FormControlLabel as te, Checkbox as ie, Button as I } from "@mui/material";
|
|
10
10
|
import { TreeSelect as Ie } from "../tree-select/index.js";
|
|
11
11
|
import we from "./components/policy-list/index.js";
|
|
12
12
|
import Pe from "./components/variables/index.js";
|
|
@@ -19,19 +19,19 @@ const Oe = {
|
|
|
19
19
|
key_ops: ["encrypt", "decrypt"],
|
|
20
20
|
kty: "oct"
|
|
21
21
|
};
|
|
22
|
-
function
|
|
23
|
-
var
|
|
22
|
+
function Ve(e, le) {
|
|
23
|
+
var V, p, S, F, k, E, R, B, D, _, A, W, N, K, M, U, j, q, G, H, J, $, Q, Y, z, X, Z;
|
|
24
24
|
const {
|
|
25
25
|
register: P,
|
|
26
|
-
handleSubmit:
|
|
26
|
+
handleSubmit: C,
|
|
27
27
|
control: s,
|
|
28
28
|
formState: { errors: ne, isDirty: ae },
|
|
29
|
-
getValues:
|
|
29
|
+
getValues: L,
|
|
30
30
|
setValue: T,
|
|
31
31
|
reset: de
|
|
32
32
|
} = be({
|
|
33
33
|
defaultValues: e.defaultValues
|
|
34
|
-
}), [re, oe] = h.useState([]), [x,
|
|
34
|
+
}), [re, oe] = h.useState([]), [x, O] = h.useState(), [pe, ce] = h.useState(0), se = h.useMemo(() => {
|
|
35
35
|
const i = [];
|
|
36
36
|
return e.mappedTemplates.forEach((l) => {
|
|
37
37
|
l.creatable || i.push(String(l.id));
|
|
@@ -56,17 +56,20 @@ function pe(e, ie) {
|
|
|
56
56
|
})();
|
|
57
57
|
}, [e.defaultValues, e.mappedTemplates, e.keyAuth]);
|
|
58
58
|
const w = () => {
|
|
59
|
-
const i =
|
|
60
|
-
x &&
|
|
59
|
+
const i = L("templateId");
|
|
60
|
+
x && O(void 0);
|
|
61
61
|
const l = ve(e.mappedTemplates);
|
|
62
62
|
oe(l);
|
|
63
63
|
for (const a of e.mappedTemplates.values())
|
|
64
64
|
if (a.id === i) {
|
|
65
|
-
|
|
65
|
+
O(a);
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
};
|
|
69
|
-
h.useImperativeHandle(
|
|
69
|
+
h.useImperativeHandle(le, () => ({
|
|
70
|
+
submitForm() {
|
|
71
|
+
C(e.onSubmit);
|
|
72
|
+
},
|
|
70
73
|
resetForm() {
|
|
71
74
|
de({
|
|
72
75
|
title: "",
|
|
@@ -79,7 +82,7 @@ function pe(e, ie) {
|
|
|
79
82
|
T(i, l);
|
|
80
83
|
},
|
|
81
84
|
getFormValue(i) {
|
|
82
|
-
return
|
|
85
|
+
return L(i);
|
|
83
86
|
}
|
|
84
87
|
})), h.useEffect(() => (w(), () => {
|
|
85
88
|
}), [e.mappedTemplates]), h.useEffect(() => {
|
|
@@ -106,10 +109,10 @@ function pe(e, ie) {
|
|
|
106
109
|
children: /* @__PURE__ */ d(
|
|
107
110
|
"form",
|
|
108
111
|
{
|
|
109
|
-
onSubmit:
|
|
112
|
+
onSubmit: C(e.onSubmit),
|
|
110
113
|
style: { display: "flex", flexDirection: "column" },
|
|
111
114
|
children: [
|
|
112
|
-
!((p = (
|
|
115
|
+
!((p = (V = e.fieldOptions) == null ? void 0 : V.title) != null && p.hidden) && /* @__PURE__ */ t(
|
|
113
116
|
u,
|
|
114
117
|
{
|
|
115
118
|
condition: e.labelPosition === "left",
|
|
@@ -131,11 +134,11 @@ function pe(e, ie) {
|
|
|
131
134
|
}
|
|
132
135
|
}
|
|
133
136
|
),
|
|
134
|
-
e.fieldOptions && ((
|
|
137
|
+
e.fieldOptions && ((S = e.fieldOptions.title) == null ? void 0 : S.helperText)
|
|
135
138
|
] })
|
|
136
139
|
}
|
|
137
140
|
),
|
|
138
|
-
!((
|
|
141
|
+
!((k = (F = e.fieldOptions) == null ? void 0 : F.description) != null && k.hidden) && /* @__PURE__ */ t(
|
|
139
142
|
u,
|
|
140
143
|
{
|
|
141
144
|
condition: e.labelPosition === "left",
|
|
@@ -151,15 +154,15 @@ function pe(e, ie) {
|
|
|
151
154
|
variant: e.inputVariant,
|
|
152
155
|
fullWidth: !0,
|
|
153
156
|
multiline: !0,
|
|
154
|
-
minRows: (
|
|
157
|
+
minRows: (R = (E = e.fieldOptions) == null ? void 0 : E.description) == null ? void 0 : R.minRows,
|
|
155
158
|
...P("description")
|
|
156
159
|
}
|
|
157
160
|
),
|
|
158
|
-
e.fieldOptions && ((
|
|
161
|
+
e.fieldOptions && ((B = e.fieldOptions.description) == null ? void 0 : B.helperText)
|
|
159
162
|
] })
|
|
160
163
|
}
|
|
161
164
|
),
|
|
162
|
-
!((
|
|
165
|
+
!((_ = (D = e.fieldOptions) == null ? void 0 : D.templateId) != null && _.hidden) && /* @__PURE__ */ t(
|
|
163
166
|
u,
|
|
164
167
|
{
|
|
165
168
|
condition: e.labelPosition === "left",
|
|
@@ -210,11 +213,11 @@ function pe(e, ie) {
|
|
|
210
213
|
}
|
|
211
214
|
}
|
|
212
215
|
),
|
|
213
|
-
e.fieldOptions && ((
|
|
216
|
+
e.fieldOptions && ((A = e.fieldOptions.templateId) == null ? void 0 : A.helperText)
|
|
214
217
|
] })
|
|
215
218
|
}
|
|
216
219
|
),
|
|
217
|
-
"aliasList" in e.defaultValues && !((
|
|
220
|
+
"aliasList" in e.defaultValues && !((N = (W = e.fieldOptions) == null ? void 0 : W.aliasList) != null && N.hidden) && /* @__PURE__ */ t(
|
|
218
221
|
f,
|
|
219
222
|
{
|
|
220
223
|
name: "aliasList",
|
|
@@ -224,7 +227,7 @@ function pe(e, ie) {
|
|
|
224
227
|
const o = (c) => {
|
|
225
228
|
const y = {
|
|
226
229
|
target: {
|
|
227
|
-
value: c.target.value.split(",").map((
|
|
230
|
+
value: c.target.value.split(",").map((ee) => ee.trimStart())
|
|
228
231
|
}
|
|
229
232
|
};
|
|
230
233
|
l(y);
|
|
@@ -257,7 +260,7 @@ function pe(e, ie) {
|
|
|
257
260
|
}
|
|
258
261
|
}
|
|
259
262
|
),
|
|
260
|
-
"appliedPolicies" in e.defaultValues && !((
|
|
263
|
+
"appliedPolicies" in e.defaultValues && !((M = (K = e.fieldOptions) == null ? void 0 : K.appliedPolicies) != null && M.hidden) && /* @__PURE__ */ t(
|
|
261
264
|
f,
|
|
262
265
|
{
|
|
263
266
|
name: "appliedPolicies",
|
|
@@ -308,7 +311,7 @@ function pe(e, ie) {
|
|
|
308
311
|
)
|
|
309
312
|
}
|
|
310
313
|
),
|
|
311
|
-
"fileInBase64" in e.defaultValues && !((
|
|
314
|
+
"fileInBase64" in e.defaultValues && !((j = (U = e.fieldOptions) == null ? void 0 : U.fileInBase64) != null && j.hidden) && /* @__PURE__ */ d(ue, { children: [
|
|
312
315
|
/* @__PURE__ */ t(
|
|
313
316
|
f,
|
|
314
317
|
{
|
|
@@ -356,7 +359,7 @@ function pe(e, ie) {
|
|
|
356
359
|
}
|
|
357
360
|
}
|
|
358
361
|
),
|
|
359
|
-
!((
|
|
362
|
+
!((G = (q = e.fieldOptions) == null ? void 0 : q.redacted) != null && G.hidden) && /* @__PURE__ */ t(
|
|
360
363
|
u,
|
|
361
364
|
{
|
|
362
365
|
condition: e.labelPosition === "left",
|
|
@@ -366,24 +369,24 @@ function pe(e, ie) {
|
|
|
366
369
|
] }),
|
|
367
370
|
children: /* @__PURE__ */ d(n, { mb: 2, children: [
|
|
368
371
|
/* @__PURE__ */ t(
|
|
369
|
-
|
|
372
|
+
te,
|
|
370
373
|
{
|
|
371
374
|
control: /* @__PURE__ */ t(
|
|
372
375
|
f,
|
|
373
376
|
{
|
|
374
377
|
name: "redacted",
|
|
375
378
|
control: s,
|
|
376
|
-
render: ({ field: { value: i, ...l } }) => /* @__PURE__ */ t(
|
|
379
|
+
render: ({ field: { value: i, ...l } }) => /* @__PURE__ */ t(ie, { checked: !!i, ...l })
|
|
377
380
|
}
|
|
378
381
|
),
|
|
379
382
|
label: e.labelPosition === "default" ? "Redacted" : void 0
|
|
380
383
|
}
|
|
381
384
|
),
|
|
382
|
-
e.fieldOptions && ((
|
|
385
|
+
e.fieldOptions && ((H = e.fieldOptions.redacted) == null ? void 0 : H.helperText)
|
|
383
386
|
] })
|
|
384
387
|
}
|
|
385
388
|
),
|
|
386
|
-
!((
|
|
389
|
+
!(($ = (J = e.fieldOptions) == null ? void 0 : J.contentEncrypted) != null && $.hidden) && /* @__PURE__ */ t(
|
|
387
390
|
u,
|
|
388
391
|
{
|
|
389
392
|
condition: e.labelPosition === "left",
|
|
@@ -393,25 +396,25 @@ function pe(e, ie) {
|
|
|
393
396
|
] }),
|
|
394
397
|
children: /* @__PURE__ */ d(n, { mb: 2, children: [
|
|
395
398
|
/* @__PURE__ */ t(
|
|
396
|
-
|
|
399
|
+
te,
|
|
397
400
|
{
|
|
398
401
|
control: /* @__PURE__ */ t(
|
|
399
402
|
f,
|
|
400
403
|
{
|
|
401
404
|
name: "contentEncrypted",
|
|
402
405
|
control: s,
|
|
403
|
-
render: ({ field: { value: i, ...l } }) => /* @__PURE__ */ t(
|
|
406
|
+
render: ({ field: { value: i, ...l } }) => /* @__PURE__ */ t(ie, { checked: !!i, ...l })
|
|
404
407
|
}
|
|
405
408
|
),
|
|
406
409
|
label: e.labelPosition === "default" ? "Content Encrypted" : void 0
|
|
407
410
|
}
|
|
408
411
|
),
|
|
409
|
-
e.fieldOptions && ((
|
|
412
|
+
e.fieldOptions && ((Q = e.fieldOptions.contentEncrypted) == null ? void 0 : Q.helperText)
|
|
410
413
|
] })
|
|
411
414
|
}
|
|
412
415
|
)
|
|
413
416
|
] }),
|
|
414
|
-
!((
|
|
417
|
+
!((z = (Y = e.fieldOptions) == null ? void 0 : Y.disseminationList) != null && z.hidden) && /* @__PURE__ */ t(
|
|
415
418
|
f,
|
|
416
419
|
{
|
|
417
420
|
name: "disseminationList",
|
|
@@ -437,7 +440,7 @@ function pe(e, ie) {
|
|
|
437
440
|
}
|
|
438
441
|
}
|
|
439
442
|
),
|
|
440
|
-
!((
|
|
443
|
+
!((Z = (X = e.fieldOptions) == null ? void 0 : X.securityLevelId) != null && Z.hidden) && /* @__PURE__ */ t(n, { mt: 2, children: /* @__PURE__ */ t(
|
|
441
444
|
f,
|
|
442
445
|
{
|
|
443
446
|
name: "securityLevelId",
|
|
@@ -526,7 +529,7 @@ function pe(e, ie) {
|
|
|
526
529
|
}
|
|
527
530
|
);
|
|
528
531
|
}
|
|
529
|
-
const je = h.forwardRef(
|
|
532
|
+
const je = h.forwardRef(Ve);
|
|
530
533
|
export {
|
|
531
534
|
je as InstanceForm
|
|
532
535
|
};
|
package/dist/main.d.ts
CHANGED