@hybridcore/ui 1.5.4 → 1.5.7
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/policy-list/index.js +0 -1
- package/dist/components/instance-form/components/variable/index.js +2 -2
- package/dist/components/instance-form/components/variables/index.js +45 -41
- package/dist/components/instance-form/index.js +293 -276
- package/dist/components/property-mapping/index.js +47 -48
- package/dist/index-D-mTkx9Q.js +349 -0
- package/dist/main.d.ts +2 -1
- package/package.json +1 -1
- package/dist/index-JgBxaIU2.js +0 -353
|
@@ -1,371 +1,388 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useForm as
|
|
5
|
-
import { getNestedChildrenFromMap as
|
|
6
|
-
import { i as
|
|
7
|
-
import { ConditionalWrapper as
|
|
8
|
-
import { Container as
|
|
9
|
-
import { TextField as v, FormGroup as
|
|
10
|
-
import { TreeSelect as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { DisseminationList as
|
|
14
|
-
import { SecurityLevel as
|
|
15
|
-
const
|
|
1
|
+
import { jsx as i, jsxs as o, Fragment as re } from "react/jsx-runtime";
|
|
2
|
+
import f from "react";
|
|
3
|
+
import de from "lodash";
|
|
4
|
+
import { useForm as oe, Controller as u } from "react-hook-form";
|
|
5
|
+
import { getNestedChildrenFromMap as se } from "../../utils/ontology.js";
|
|
6
|
+
import { i as ce, d as me } from "../../utils-Bq0ye5vf.js";
|
|
7
|
+
import { ConditionalWrapper as ue } from "../conditional-wrapper/index.js";
|
|
8
|
+
import { Container as fe } from "../container/index.js";
|
|
9
|
+
import { Box as s, TextField as v, FormGroup as he, FormControl as ve, InputLabel as be, Select as ye, MenuItem as Te, FormControlLabel as J, Checkbox as $, Button as g } from "@mui/material";
|
|
10
|
+
import { TreeSelect as ge } from "../tree-select/index.js";
|
|
11
|
+
import pe from "./components/policy-list/index.js";
|
|
12
|
+
import Ie from "./components/variables/index.js";
|
|
13
|
+
import { DisseminationList as xe } from "../data-security-selectors/dissemination-list/index.js";
|
|
14
|
+
import { SecurityLevel as Ce } from "../data-security-selectors/security-level/index.js";
|
|
15
|
+
const Oe = {
|
|
16
16
|
alg: "A256GCM",
|
|
17
17
|
ext: !0,
|
|
18
18
|
k: "_El6rHQxC5E7NdO5DiMDITjF7f65wrlaJmFVagVE9Ic",
|
|
19
19
|
key_ops: ["encrypt", "decrypt"],
|
|
20
20
|
kty: "oct"
|
|
21
|
-
},
|
|
21
|
+
}, Le = [
|
|
22
22
|
"IMAGE",
|
|
23
23
|
"VIDEO",
|
|
24
24
|
"TEXT",
|
|
25
25
|
"BINARY",
|
|
26
26
|
"OTHER"
|
|
27
27
|
];
|
|
28
|
-
function
|
|
29
|
-
var L, V, S, E, F, k,
|
|
28
|
+
function Ve(e, Q) {
|
|
29
|
+
var L, V, S, E, F, k, R, w, B, _, A, D, P, W, M, N, G, K, U, j, q, H, Y;
|
|
30
30
|
const {
|
|
31
|
-
register:
|
|
32
|
-
handleSubmit:
|
|
33
|
-
control:
|
|
34
|
-
formState: { errors:
|
|
35
|
-
getValues:
|
|
31
|
+
register: x,
|
|
32
|
+
handleSubmit: X,
|
|
33
|
+
control: c,
|
|
34
|
+
formState: { errors: z, isDirty: Z },
|
|
35
|
+
getValues: C,
|
|
36
36
|
setValue: b,
|
|
37
|
-
reset:
|
|
38
|
-
} =
|
|
37
|
+
reset: ee
|
|
38
|
+
} = oe({
|
|
39
39
|
defaultValues: e.defaultValues
|
|
40
|
-
}), [
|
|
40
|
+
}), [te, ie] = f.useState([]), [y, O] = f.useState(), [Se, ne] = f.useState(0), le = f.useMemo(() => {
|
|
41
41
|
const t = [];
|
|
42
|
-
return e.mappedTemplates.forEach((
|
|
43
|
-
|
|
42
|
+
return e.mappedTemplates.forEach((n) => {
|
|
43
|
+
n.creatable || t.push(String(n.id));
|
|
44
44
|
}), t;
|
|
45
45
|
}, [e.mappedTemplates]);
|
|
46
|
-
|
|
46
|
+
f.useEffect(() => {
|
|
47
47
|
(async () => {
|
|
48
|
-
const t = { ...e.defaultValues },
|
|
49
|
-
if (
|
|
50
|
-
const
|
|
51
|
-
(
|
|
48
|
+
const t = { ...e.defaultValues }, n = e.mappedTemplates.get(t.templateId);
|
|
49
|
+
if (n) {
|
|
50
|
+
const a = n.properties.filter(
|
|
51
|
+
(r) => r.privacyPreservationMethod === "ENCRYPTION"
|
|
52
52
|
);
|
|
53
|
-
if (
|
|
54
|
-
for (let
|
|
55
|
-
const l = r
|
|
53
|
+
if (a.length > 0)
|
|
54
|
+
for (let r = 0; r < a.length; r++) {
|
|
55
|
+
const l = a[r], d = de.get(t, `variables.${l.propertyId}`);
|
|
56
56
|
if (d && e.keyAuth) {
|
|
57
|
-
const
|
|
58
|
-
|
|
57
|
+
const m = await ce(Oe), h = await me(m, String(d));
|
|
58
|
+
h.data && (b(`variables.${l.propertyId}`, h.data), ne((T) => T + 1));
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
})();
|
|
63
63
|
}, [e.defaultValues, e.mappedTemplates, e.keyAuth]);
|
|
64
|
-
const
|
|
65
|
-
const t =
|
|
66
|
-
y &&
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
for (const
|
|
70
|
-
if (
|
|
71
|
-
|
|
64
|
+
const p = () => {
|
|
65
|
+
const t = C("templateId");
|
|
66
|
+
y && O(void 0);
|
|
67
|
+
const n = se(e.mappedTemplates);
|
|
68
|
+
ie(n);
|
|
69
|
+
for (const a of e.mappedTemplates.values())
|
|
70
|
+
if (a.id === t) {
|
|
71
|
+
O(a);
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
|
-
|
|
75
|
+
f.useImperativeHandle(Q, () => ({
|
|
76
76
|
resetForm() {
|
|
77
|
-
|
|
77
|
+
ee({
|
|
78
78
|
title: "",
|
|
79
79
|
description: "",
|
|
80
80
|
templateId: 0,
|
|
81
81
|
variables: {}
|
|
82
|
-
}),
|
|
82
|
+
}), p();
|
|
83
83
|
},
|
|
84
|
-
setFormValue(t,
|
|
85
|
-
b(t,
|
|
84
|
+
setFormValue(t, n) {
|
|
85
|
+
b(t, n);
|
|
86
86
|
},
|
|
87
87
|
getFormValue(t) {
|
|
88
|
-
return
|
|
88
|
+
return C(t);
|
|
89
89
|
}
|
|
90
|
-
})),
|
|
91
|
-
}), [e.mappedTemplates]),
|
|
90
|
+
})), f.useEffect(() => (p(), () => {
|
|
91
|
+
}), [e.mappedTemplates]), f.useEffect(() => {
|
|
92
92
|
e.onSelectedTemplateChange && e.onSelectedTemplateChange(y);
|
|
93
93
|
}, [y]);
|
|
94
|
-
const
|
|
94
|
+
const ae = () => {
|
|
95
95
|
if (e.onCancel) {
|
|
96
|
-
e.onCancel();
|
|
96
|
+
e.onCancel(Z);
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
-
return /* @__PURE__ */
|
|
101
|
-
|
|
100
|
+
return /* @__PURE__ */ i(
|
|
101
|
+
ue,
|
|
102
102
|
{
|
|
103
103
|
condition: e.variant === void 0 || e.variant === "inline",
|
|
104
|
-
wrapper: (t) => /* @__PURE__ */
|
|
105
|
-
|
|
104
|
+
wrapper: (t) => /* @__PURE__ */ i(
|
|
105
|
+
fe,
|
|
106
106
|
{
|
|
107
107
|
disableHeader: !0,
|
|
108
108
|
sx: { position: "relative", overflow: "visible" },
|
|
109
109
|
children: t
|
|
110
110
|
}
|
|
111
111
|
),
|
|
112
|
-
children: /* @__PURE__ */
|
|
112
|
+
children: /* @__PURE__ */ o(
|
|
113
113
|
"form",
|
|
114
114
|
{
|
|
115
|
-
onSubmit:
|
|
115
|
+
onSubmit: X(e.onSubmit),
|
|
116
116
|
style: { display: "flex", flexDirection: "column" },
|
|
117
117
|
children: [
|
|
118
|
-
!((V = (L = e.fieldOptions) == null ? void 0 : L.title) != null && V.hidden) && /* @__PURE__ */
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
118
|
+
!((V = (L = e.fieldOptions) == null ? void 0 : L.title) != null && V.hidden) && /* @__PURE__ */ o(s, { mb: 2, children: [
|
|
119
|
+
/* @__PURE__ */ i(
|
|
120
|
+
v,
|
|
121
|
+
{
|
|
122
|
+
label: "Title *",
|
|
123
|
+
variant: e.inputVariant,
|
|
124
|
+
fullWidth: !0,
|
|
125
|
+
...x("title", { required: !0 }),
|
|
126
|
+
...z.title && {
|
|
127
|
+
helperText: "This field is required!",
|
|
128
|
+
error: !0
|
|
129
|
+
}
|
|
129
130
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
131
|
+
),
|
|
132
|
+
e.fieldOptions && ((S = e.fieldOptions.title) == null ? void 0 : S.helperText)
|
|
133
|
+
] }),
|
|
134
|
+
!((F = (E = e.fieldOptions) == null ? void 0 : E.description) != null && F.hidden) && /* @__PURE__ */ o(s, { mb: 2, children: [
|
|
135
|
+
/* @__PURE__ */ i(
|
|
136
|
+
v,
|
|
137
|
+
{
|
|
138
|
+
label: "Description",
|
|
139
|
+
variant: e.inputVariant,
|
|
140
|
+
fullWidth: !0,
|
|
141
|
+
multiline: !0,
|
|
142
|
+
minRows: (R = (k = e.fieldOptions) == null ? void 0 : k.description) == null ? void 0 : R.minRows,
|
|
143
|
+
...x("description")
|
|
144
|
+
}
|
|
145
|
+
),
|
|
146
|
+
e.fieldOptions && ((w = e.fieldOptions.description) == null ? void 0 : w.helperText)
|
|
147
|
+
] }),
|
|
148
|
+
!((_ = (B = e.fieldOptions) == null ? void 0 : B.templateId) != null && _.hidden) && /* @__PURE__ */ o(he, { sx: { mb: 2 }, children: [
|
|
149
|
+
/* @__PURE__ */ i(
|
|
150
|
+
u,
|
|
151
|
+
{
|
|
152
|
+
name: "templateId",
|
|
153
|
+
control: c,
|
|
154
|
+
render: ({ field: { value: t, onChange: n } }) => {
|
|
155
|
+
var a, r;
|
|
156
|
+
if ((r = (a = e.fieldOptions) == null ? void 0 : a.templateId) != null && r.disabled) {
|
|
157
|
+
const l = t ? e.mappedTemplates.get(t) : void 0;
|
|
158
|
+
return /* @__PURE__ */ i(
|
|
159
|
+
v,
|
|
160
|
+
{
|
|
161
|
+
label: "Template",
|
|
162
|
+
variant: e.inputVariant,
|
|
163
|
+
fullWidth: !0,
|
|
164
|
+
disabled: !0,
|
|
165
|
+
value: l == null ? void 0 : l.name,
|
|
166
|
+
InputLabelProps: { shrink: !0 }
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
return /* @__PURE__ */ i(
|
|
171
|
+
ge,
|
|
155
172
|
{
|
|
156
173
|
label: "Template",
|
|
174
|
+
data: te,
|
|
175
|
+
selected: t === 0 ? "" : [String(t)],
|
|
176
|
+
disabled: le,
|
|
157
177
|
variant: e.inputVariant,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
178
|
+
onChange: (l, d) => {
|
|
179
|
+
const m = {
|
|
180
|
+
target: {
|
|
181
|
+
value: d ? Number(l) : 0
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
n(m), p();
|
|
185
|
+
}
|
|
162
186
|
}
|
|
163
187
|
);
|
|
164
188
|
}
|
|
165
|
-
return /* @__PURE__ */ n(
|
|
166
|
-
ue,
|
|
167
|
-
{
|
|
168
|
-
label: "Template",
|
|
169
|
-
data: J,
|
|
170
|
-
selected: t === 0 ? "" : [String(t)],
|
|
171
|
-
disabled: X,
|
|
172
|
-
variant: e.inputVariant,
|
|
173
|
-
onChange: (l, d) => {
|
|
174
|
-
const c = {
|
|
175
|
-
target: {
|
|
176
|
-
value: d ? Number(l) : 0
|
|
177
|
-
}
|
|
178
|
-
};
|
|
179
|
-
a(c), T();
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
);
|
|
183
189
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
190
|
+
),
|
|
191
|
+
e.fieldOptions && ((A = e.fieldOptions.templateId) == null ? void 0 : A.helperText)
|
|
192
|
+
] }),
|
|
193
|
+
"aliasList" in e.defaultValues && !((P = (D = e.fieldOptions) == null ? void 0 : D.aliasList) != null && P.hidden) && /* @__PURE__ */ i(
|
|
194
|
+
u,
|
|
188
195
|
{
|
|
189
196
|
name: "aliasList",
|
|
190
|
-
control:
|
|
191
|
-
render: ({ field: { value: t, onChange:
|
|
192
|
-
|
|
193
|
-
|
|
197
|
+
control: c,
|
|
198
|
+
render: ({ field: { value: t, onChange: n, ...a } }) => {
|
|
199
|
+
var l;
|
|
200
|
+
const r = (d) => {
|
|
201
|
+
const T = {
|
|
194
202
|
target: {
|
|
195
|
-
value:
|
|
203
|
+
value: d.target.value.split(",").map((I) => I.trimStart())
|
|
196
204
|
}
|
|
197
205
|
};
|
|
198
|
-
|
|
206
|
+
n(T);
|
|
199
207
|
};
|
|
200
|
-
return /* @__PURE__ */
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
208
|
+
return /* @__PURE__ */ o(s, { mb: 2, children: [
|
|
209
|
+
/* @__PURE__ */ i(
|
|
210
|
+
v,
|
|
211
|
+
{
|
|
212
|
+
label: "Alias List",
|
|
213
|
+
variant: e.inputVariant,
|
|
214
|
+
fullWidth: !0,
|
|
215
|
+
value: t,
|
|
216
|
+
helperText: "Add list values with the comma (,) separated string",
|
|
217
|
+
onChange: r,
|
|
218
|
+
...a
|
|
219
|
+
}
|
|
220
|
+
),
|
|
221
|
+
e.fieldOptions && ((l = e.fieldOptions.aliasList) == null ? void 0 : l.helperText)
|
|
222
|
+
] });
|
|
213
223
|
}
|
|
214
224
|
}
|
|
215
225
|
),
|
|
216
|
-
"appliedPolicies" in e.defaultValues && !((
|
|
217
|
-
|
|
226
|
+
"appliedPolicies" in e.defaultValues && !((M = (W = e.fieldOptions) == null ? void 0 : W.appliedPolicies) != null && M.hidden) && /* @__PURE__ */ i(
|
|
227
|
+
u,
|
|
218
228
|
{
|
|
219
229
|
name: "appliedPolicies",
|
|
220
|
-
control:
|
|
221
|
-
render: ({ field: { value: t, onChange:
|
|
222
|
-
|
|
223
|
-
{
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
230
|
+
control: c,
|
|
231
|
+
render: ({ field: { value: t, onChange: n } }) => {
|
|
232
|
+
var a;
|
|
233
|
+
return /* @__PURE__ */ o(s, { mb: 2, children: [
|
|
234
|
+
/* @__PURE__ */ i(
|
|
235
|
+
pe,
|
|
236
|
+
{
|
|
237
|
+
policyList: e.policyList,
|
|
238
|
+
value: t || void 0,
|
|
239
|
+
onChange: n
|
|
240
|
+
}
|
|
241
|
+
),
|
|
242
|
+
e.fieldOptions && ((a = e.fieldOptions.appliedPolicies) == null ? void 0 : a.helperText)
|
|
243
|
+
] });
|
|
244
|
+
}
|
|
229
245
|
}
|
|
230
246
|
),
|
|
231
|
-
/* @__PURE__ */
|
|
232
|
-
|
|
247
|
+
/* @__PURE__ */ i(
|
|
248
|
+
u,
|
|
233
249
|
{
|
|
234
250
|
name: "variables",
|
|
235
|
-
control:
|
|
236
|
-
render: ({ field: { value: t, onChange:
|
|
237
|
-
|
|
251
|
+
control: c,
|
|
252
|
+
render: ({ field: { value: t, onChange: n } }) => /* @__PURE__ */ i(
|
|
253
|
+
Ie,
|
|
238
254
|
{
|
|
239
255
|
template: y,
|
|
240
256
|
value: t,
|
|
241
257
|
mapboxAccessToken: e.mapboxAccessToken,
|
|
242
258
|
variant: e.inputVariant,
|
|
243
259
|
fieldOptions: e.fieldOptions,
|
|
244
|
-
onChange:
|
|
260
|
+
onChange: n
|
|
245
261
|
}
|
|
246
262
|
)
|
|
247
263
|
}
|
|
248
264
|
),
|
|
249
|
-
"fileInBase64" in e.defaultValues && !((
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
-
|
|
265
|
+
"fileInBase64" in e.defaultValues && !((G = (N = e.fieldOptions) == null ? void 0 : N.fileInBase64) != null && G.hidden) && /* @__PURE__ */ o(re, { children: [
|
|
266
|
+
/* @__PURE__ */ i(
|
|
267
|
+
u,
|
|
252
268
|
{
|
|
253
269
|
name: "fileInBase64",
|
|
254
|
-
control:
|
|
255
|
-
render: ({ field: { onChange: t, ...
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
270
|
+
control: c,
|
|
271
|
+
render: ({ field: { onChange: t, ...n } }) => {
|
|
272
|
+
var r;
|
|
273
|
+
const a = (l) => {
|
|
274
|
+
if (l.target.files) {
|
|
275
|
+
const d = new FileReader();
|
|
276
|
+
d.onload = async (h) => {
|
|
277
|
+
const I = h.target.result.split("base64,")[1];
|
|
278
|
+
t(I);
|
|
262
279
|
};
|
|
263
|
-
const
|
|
264
|
-
b("originalFileName",
|
|
280
|
+
const m = l.target.files[0];
|
|
281
|
+
b("originalFileName", m.name), b("contentType", m.type), d.readAsDataURL(m);
|
|
265
282
|
}
|
|
266
283
|
};
|
|
267
|
-
return /* @__PURE__ */
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
284
|
+
return /* @__PURE__ */ o(s, { mb: 2, children: [
|
|
285
|
+
/* @__PURE__ */ i(
|
|
286
|
+
v,
|
|
287
|
+
{
|
|
288
|
+
type: "file",
|
|
289
|
+
label: "File to Upload",
|
|
290
|
+
variant: e.inputVariant,
|
|
291
|
+
fullWidth: !0,
|
|
292
|
+
helperText: "Select a file to upload",
|
|
293
|
+
InputLabelProps: { shrink: !0 },
|
|
294
|
+
onChange: a,
|
|
295
|
+
...n
|
|
296
|
+
}
|
|
297
|
+
),
|
|
298
|
+
e.fieldOptions && ((r = e.fieldOptions.fileInBase64) == null ? void 0 : r.helperText)
|
|
299
|
+
] });
|
|
281
300
|
}
|
|
282
301
|
}
|
|
283
302
|
),
|
|
284
|
-
/* @__PURE__ */
|
|
285
|
-
|
|
303
|
+
/* @__PURE__ */ i(
|
|
304
|
+
u,
|
|
286
305
|
{
|
|
287
306
|
name: "type",
|
|
288
|
-
control:
|
|
289
|
-
render: ({ field: { value: t, onChange:
|
|
290
|
-
|
|
307
|
+
control: c,
|
|
308
|
+
render: ({ field: { value: t, onChange: n } }) => {
|
|
309
|
+
var r;
|
|
310
|
+
const a = (l) => {
|
|
291
311
|
const {
|
|
292
|
-
target: { value:
|
|
293
|
-
} =
|
|
294
|
-
|
|
312
|
+
target: { value: d }
|
|
313
|
+
} = l;
|
|
314
|
+
n(d);
|
|
295
315
|
};
|
|
296
|
-
return /* @__PURE__ */
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
onChange: r,
|
|
311
|
-
children: ge.map((i) => /* @__PURE__ */ n(ce, { value: i, children: i }, i))
|
|
312
|
-
}
|
|
313
|
-
)
|
|
314
|
-
]
|
|
315
|
-
}
|
|
316
|
-
);
|
|
316
|
+
return /* @__PURE__ */ o(s, { mb: 2, children: [
|
|
317
|
+
/* @__PURE__ */ o(ve, { fullWidth: !0, variant: e.inputVariant, children: [
|
|
318
|
+
/* @__PURE__ */ i(be, { children: "Type" }),
|
|
319
|
+
/* @__PURE__ */ i(
|
|
320
|
+
ye,
|
|
321
|
+
{
|
|
322
|
+
value: t ? [t] : "",
|
|
323
|
+
onChange: a,
|
|
324
|
+
children: Le.map((l) => /* @__PURE__ */ i(Te, { value: l, children: l }, l))
|
|
325
|
+
}
|
|
326
|
+
)
|
|
327
|
+
] }),
|
|
328
|
+
e.fieldOptions && ((r = e.fieldOptions.type) == null ? void 0 : r.helperText)
|
|
329
|
+
] });
|
|
317
330
|
}
|
|
318
331
|
}
|
|
319
332
|
),
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
333
|
+
/* @__PURE__ */ o(s, { mb: 2, children: [
|
|
334
|
+
/* @__PURE__ */ i(
|
|
335
|
+
J,
|
|
336
|
+
{
|
|
337
|
+
control: /* @__PURE__ */ i(
|
|
338
|
+
u,
|
|
339
|
+
{
|
|
340
|
+
name: "redacted",
|
|
341
|
+
control: c,
|
|
342
|
+
render: ({ field: { value: t, ...n } }) => /* @__PURE__ */ i($, { checked: !!t, ...n })
|
|
343
|
+
}
|
|
344
|
+
),
|
|
345
|
+
label: "Redacted"
|
|
346
|
+
}
|
|
347
|
+
),
|
|
348
|
+
e.fieldOptions && ((K = e.fieldOptions.redacted) == null ? void 0 : K.helperText)
|
|
349
|
+
] }),
|
|
350
|
+
/* @__PURE__ */ o(s, { mb: 2, children: [
|
|
351
|
+
/* @__PURE__ */ i(
|
|
352
|
+
J,
|
|
353
|
+
{
|
|
354
|
+
control: /* @__PURE__ */ i(
|
|
355
|
+
u,
|
|
356
|
+
{
|
|
357
|
+
name: "contentEncrypted",
|
|
358
|
+
control: c,
|
|
359
|
+
render: ({ field: { value: t, ...n } }) => /* @__PURE__ */ i($, { checked: !!t, ...n })
|
|
360
|
+
}
|
|
361
|
+
),
|
|
362
|
+
label: "Content Encrypted"
|
|
363
|
+
}
|
|
364
|
+
),
|
|
365
|
+
e.fieldOptions && ((U = e.fieldOptions.contentEncrypted) == null ? void 0 : U.helperText)
|
|
366
|
+
] })
|
|
350
367
|
] }),
|
|
351
|
-
!((
|
|
352
|
-
|
|
368
|
+
!((q = (j = e.fieldOptions) == null ? void 0 : j.disseminationList) != null && q.hidden) && /* @__PURE__ */ i(
|
|
369
|
+
u,
|
|
353
370
|
{
|
|
354
371
|
name: "disseminationList",
|
|
355
372
|
rules: {
|
|
356
373
|
required: !0
|
|
357
374
|
},
|
|
358
|
-
control:
|
|
359
|
-
render: ({ field: { value: t, onChange:
|
|
360
|
-
const
|
|
361
|
-
|
|
375
|
+
control: c,
|
|
376
|
+
render: ({ field: { value: t, onChange: n }, fieldState: a }) => {
|
|
377
|
+
const r = t || [], l = (d) => {
|
|
378
|
+
n(d);
|
|
362
379
|
};
|
|
363
|
-
return /* @__PURE__ */
|
|
364
|
-
|
|
380
|
+
return /* @__PURE__ */ i(
|
|
381
|
+
xe,
|
|
365
382
|
{
|
|
366
|
-
selectedIds:
|
|
383
|
+
selectedIds: r,
|
|
367
384
|
memberedGroups: e.memberedGroups,
|
|
368
|
-
showError: !!
|
|
385
|
+
showError: !!a.error,
|
|
369
386
|
variant: e.inputVariant,
|
|
370
387
|
onChange: l
|
|
371
388
|
}
|
|
@@ -373,21 +390,21 @@ function Te(e, j) {
|
|
|
373
390
|
}
|
|
374
391
|
}
|
|
375
392
|
),
|
|
376
|
-
!((
|
|
377
|
-
|
|
393
|
+
!((Y = (H = e.fieldOptions) == null ? void 0 : H.securityLevelId) != null && Y.hidden) && /* @__PURE__ */ i(s, { mt: 2, children: /* @__PURE__ */ i(
|
|
394
|
+
u,
|
|
378
395
|
{
|
|
379
396
|
name: "securityLevelId",
|
|
380
397
|
rules: {
|
|
381
398
|
required: !0
|
|
382
399
|
},
|
|
383
|
-
control:
|
|
384
|
-
render: ({ field: { value: t, onChange:
|
|
400
|
+
control: c,
|
|
401
|
+
render: ({ field: { value: t, onChange: n }, fieldState: a }) => {
|
|
385
402
|
var l, d;
|
|
386
|
-
const
|
|
387
|
-
|
|
403
|
+
const r = (m) => {
|
|
404
|
+
n(m);
|
|
388
405
|
};
|
|
389
|
-
return /* @__PURE__ */
|
|
390
|
-
|
|
406
|
+
return /* @__PURE__ */ i(
|
|
407
|
+
Ce,
|
|
391
408
|
{
|
|
392
409
|
value: t || 0,
|
|
393
410
|
ontologyId: e.ontologyId,
|
|
@@ -396,28 +413,28 @@ function Te(e, j) {
|
|
|
396
413
|
minLevelId: e.minSecurityLevel,
|
|
397
414
|
templateKeys: (l = e.securityLevelConfig) == null ? void 0 : l.templateKeys,
|
|
398
415
|
templateType: (d = e.securityLevelConfig) == null ? void 0 : d.templateType,
|
|
399
|
-
showError: !!
|
|
416
|
+
showError: !!a.error,
|
|
400
417
|
variant: e.inputVariant,
|
|
401
|
-
onChange:
|
|
418
|
+
onChange: r
|
|
402
419
|
}
|
|
403
420
|
);
|
|
404
421
|
}
|
|
405
422
|
}
|
|
406
423
|
) }),
|
|
407
|
-
/* @__PURE__ */
|
|
408
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ o(s, { display: "flex", justifyContent: "space-between", mt: 3, children: [
|
|
425
|
+
/* @__PURE__ */ i(
|
|
409
426
|
g,
|
|
410
427
|
{
|
|
411
428
|
color: "primary",
|
|
412
429
|
variant: "text",
|
|
413
430
|
disabled: e.loading,
|
|
414
431
|
sx: { textTransform: "none" },
|
|
415
|
-
onClick:
|
|
432
|
+
onClick: ae,
|
|
416
433
|
children: "Cancel"
|
|
417
434
|
}
|
|
418
435
|
),
|
|
419
|
-
/* @__PURE__ */
|
|
420
|
-
e.onRemove !== void 0 && /* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ o(s, { children: [
|
|
437
|
+
e.onRemove !== void 0 && /* @__PURE__ */ i(
|
|
421
438
|
g,
|
|
422
439
|
{
|
|
423
440
|
type: "button",
|
|
@@ -429,7 +446,7 @@ function Te(e, j) {
|
|
|
429
446
|
children: e.removeLoading ? "Deleting..." : "Delete"
|
|
430
447
|
}
|
|
431
448
|
),
|
|
432
|
-
e.saveButtons ? e.saveButtons.map((t,
|
|
449
|
+
e.saveButtons ? e.saveButtons.map((t, n) => /* @__PURE__ */ i(
|
|
433
450
|
g,
|
|
434
451
|
{
|
|
435
452
|
type: "submit",
|
|
@@ -441,8 +458,8 @@ function Te(e, j) {
|
|
|
441
458
|
onClick: t.onClick,
|
|
442
459
|
children: t.label
|
|
443
460
|
},
|
|
444
|
-
|
|
445
|
-
)) : /* @__PURE__ */
|
|
461
|
+
n
|
|
462
|
+
)) : /* @__PURE__ */ i(
|
|
446
463
|
g,
|
|
447
464
|
{
|
|
448
465
|
type: "submit",
|
|
@@ -461,7 +478,7 @@ function Te(e, j) {
|
|
|
461
478
|
}
|
|
462
479
|
);
|
|
463
480
|
}
|
|
464
|
-
const
|
|
481
|
+
const Ke = f.forwardRef(Ve);
|
|
465
482
|
export {
|
|
466
|
-
|
|
483
|
+
Ke as InstanceForm
|
|
467
484
|
};
|