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