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