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