@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.
@@ -1,405 +1,489 @@
1
- import { jsx as i, jsxs as o, Fragment as me } from "react/jsx-runtime";
2
- import u from "react";
3
- import fe from "lodash";
4
- import { useForm as ue, Controller as f } from "react-hook-form";
5
- import { getNestedChildrenFromMap as he } from "../../utils/ontology.js";
6
- import { i as ve, d as be } from "../../utils-Bq0ye5vf.js";
7
- import { ConditionalWrapper as ye } from "../conditional-wrapper/index.js";
8
- import { Container as ge } from "../container/index.js";
9
- import { Box as s, TextField as b, FormGroup as Te, FormControlLabel as X, Checkbox as Z, Button as T } from "@mui/material";
10
- import { TreeSelect as xe } from "../tree-select/index.js";
11
- import Oe from "./components/policy-list/index.js";
12
- import pe from "./components/variables/index.js";
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 Ie } from "../data-security-selectors/security-level/index.js";
15
- const Le = {
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 Ve(e, ee) {
23
- var I, L, V, S, k, F, E, R, w, B, D, P, _, A, W, N, K, M, j, q, G, U, H, J, $, Q, Y;
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: O,
26
- handleSubmit: te,
27
- control: c,
28
- formState: { errors: ie, isDirty: ne },
29
- getValues: p,
30
- setValue: y,
31
- reset: ae
32
- } = ue({
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
- }), [le, de] = u.useState([]), [g, C] = u.useState(), [Se, re] = u.useState(0), oe = u.useMemo(() => {
35
- const t = [];
36
- return e.mappedTemplates.forEach((n) => {
37
- n.creatable || t.push(String(n.id));
38
- }), t;
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
- u.useEffect(() => {
40
+ h.useEffect(() => {
41
41
  (async () => {
42
- const t = { ...e.defaultValues }, n = e.mappedTemplates.get(t.templateId);
43
- if (n) {
44
- const a = n.properties.filter(
45
- (d) => d.privacyPreservationMethod === "ENCRYPTION"
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 d = 0; d < a.length; d++) {
49
- const l = a[d], r = fe.get(t, `variables.${l.propertyId}`);
50
- if (r && e.keyAuth) {
51
- const m = await ve(Le), h = await be(m, String(r));
52
- h.data && (y(`variables.${l.propertyId}`, h.data), re((v) => v + 1));
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 x = () => {
59
- const t = p("templateId");
60
- g && C(void 0);
61
- const n = he(e.mappedTemplates);
62
- de(n);
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 === t) {
65
- C(a);
64
+ if (a.id === i) {
65
+ L(a);
66
66
  break;
67
67
  }
68
68
  };
69
- u.useImperativeHandle(ee, () => ({
69
+ h.useImperativeHandle(ie, () => ({
70
70
  resetForm() {
71
- ae({
71
+ de({
72
72
  title: "",
73
73
  description: "",
74
74
  templateId: 0,
75
75
  variables: {}
76
- }), x();
76
+ }), w();
77
77
  },
78
- setFormValue(t, n) {
79
- y(t, n);
78
+ setFormValue(i, l) {
79
+ T(i, l);
80
80
  },
81
- getFormValue(t) {
82
- return p(t);
81
+ getFormValue(i) {
82
+ return C(i);
83
83
  }
84
- })), u.useEffect(() => (x(), () => {
85
- }), [e.mappedTemplates]), u.useEffect(() => {
86
- e.onSelectedTemplateChange && e.onSelectedTemplateChange(g);
87
- }, [g]);
88
- const se = () => {
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(ne);
90
+ e.onCancel(ae);
91
91
  return;
92
92
  }
93
93
  };
94
- return /* @__PURE__ */ i(
95
- ye,
94
+ return /* @__PURE__ */ t(
95
+ u,
96
96
  {
97
97
  condition: e.variant === void 0 || e.variant === "inline",
98
- wrapper: (t) => /* @__PURE__ */ i(
99
- ge,
98
+ wrapper: (i) => /* @__PURE__ */ t(
99
+ Te,
100
100
  {
101
101
  disableHeader: !0,
102
102
  sx: { position: "relative", overflow: "visible" },
103
- children: t
103
+ children: i
104
104
  }
105
105
  ),
106
- children: /* @__PURE__ */ o(
106
+ children: /* @__PURE__ */ d(
107
107
  "form",
108
108
  {
109
- onSubmit: te(e.onSubmit),
109
+ onSubmit: le(e.onSubmit),
110
110
  style: { display: "flex", flexDirection: "column" },
111
111
  children: [
112
- !((L = (I = e.fieldOptions) == null ? void 0 : I.title) != null && L.hidden) && /* @__PURE__ */ o(s, { mb: 2, children: [
113
- /* @__PURE__ */ i(
114
- b,
115
- {
116
- label: "Title *",
117
- variant: e.inputVariant,
118
- fullWidth: !0,
119
- ...O("title", { required: !0 }),
120
- ...ie.title && {
121
- helperText: "This field is required!",
122
- error: !0
123
- }
124
- }
125
- ),
126
- e.fieldOptions && ((V = e.fieldOptions.title) == null ? void 0 : V.helperText)
127
- ] }),
128
- !((k = (S = e.fieldOptions) == null ? void 0 : S.description) != null && k.hidden) && /* @__PURE__ */ o(s, { mb: 2, children: [
129
- /* @__PURE__ */ i(
130
- b,
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
- return /* @__PURE__ */ i(
165
- xe,
166
- {
167
- label: "Template",
168
- data: le,
169
- selected: t === 0 ? "" : [String(t)],
170
- disabled: oe,
171
- variant: e.inputVariant,
172
- onChange: (l, r) => {
173
- const m = {
174
- target: {
175
- value: r ? Number(l) : 0
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
- e.fieldOptions && ((D = e.fieldOptions.templateId) == null ? void 0 : D.helperText)
186
- ] }),
187
- "aliasList" in e.defaultValues && !((_ = (P = e.fieldOptions) == null ? void 0 : P.aliasList) != null && _.hidden) && /* @__PURE__ */ i(
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: c,
192
- render: ({ field: { value: t, onChange: n, ...a } }) => {
193
- var l;
194
- const d = (r) => {
195
- const v = {
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: r.target.value.split(",").map((z) => z.trimStart())
227
+ value: c.target.value.split(",").map((Z) => Z.trimStart())
198
228
  }
199
229
  };
200
- n(v);
230
+ l(y);
201
231
  };
202
- return /* @__PURE__ */ o(s, { mb: 2, children: [
203
- /* @__PURE__ */ i(
204
- b,
205
- {
206
- label: "Alias List",
207
- variant: e.inputVariant,
208
- fullWidth: !0,
209
- value: t,
210
- helperText: "Add list values with the comma (,) separated string",
211
- onChange: d,
212
- ...a
213
- }
214
- ),
215
- e.fieldOptions && ((l = e.fieldOptions.aliasList) == null ? void 0 : l.helperText)
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 && !((W = (A = e.fieldOptions) == null ? void 0 : A.appliedPolicies) != null && W.hidden) && /* @__PURE__ */ i(
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: c,
225
- render: ({ field: { value: t, onChange: n } }) => {
264
+ control: s,
265
+ render: ({ field: { value: i, onChange: l } }) => {
226
266
  var a;
227
- return /* @__PURE__ */ o(s, { mb: 2, children: [
228
- /* @__PURE__ */ i(
229
- Oe,
230
- {
231
- policyList: e.policyList,
232
- value: t || void 0,
233
- onChange: n
234
- }
235
- ),
236
- e.fieldOptions && ((a = e.fieldOptions.appliedPolicies) == null ? void 0 : a.helperText)
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__ */ i(
292
+ /* @__PURE__ */ t(
242
293
  f,
243
294
  {
244
295
  name: "variables",
245
- control: c,
246
- render: ({ field: { value: t, onChange: n } }) => /* @__PURE__ */ i(
247
- pe,
296
+ control: s,
297
+ render: ({ field: { value: i, onChange: l } }) => /* @__PURE__ */ t(
298
+ Pe,
248
299
  {
249
- template: g,
250
- value: t,
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: n
306
+ onChange: l
255
307
  }
256
308
  )
257
309
  }
258
310
  ),
259
- "fileInBase64" in e.defaultValues && !((K = (N = e.fieldOptions) == null ? void 0 : N.fileInBase64) != null && K.hidden) && /* @__PURE__ */ o(me, { children: [
260
- /* @__PURE__ */ i(
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: c,
265
- render: ({ field: { onChange: t, value: n, ...a } }) => {
266
- var l;
267
- const d = (r) => {
268
- if (r.target.files) {
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 (v) => {
271
- const ce = v.target.result.split("base64,")[1];
272
- t(ce);
322
+ m.onload = async (y) => {
323
+ const fe = y.target.result.split("base64,")[1];
324
+ i(fe);
273
325
  };
274
- const h = r.target.files[0];
275
- y("originalFileName", h.name), y("contentType", h.type), m.readAsDataURL(h);
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__ */ o(s, { mb: 2, children: [
279
- /* @__PURE__ */ i(
280
- b,
281
- {
282
- type: "file",
283
- label: "File to Upload",
284
- variant: e.inputVariant,
285
- fullWidth: !0,
286
- helperText: "Select a file to upload",
287
- InputLabelProps: { shrink: !0 },
288
- onChange: d,
289
- ...a
290
- }
291
- ),
292
- e.fieldOptions && ((l = e.fieldOptions.fileInBase64) == null ? void 0 : l.helperText)
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
- !((j = (M = e.fieldOptions) == null ? void 0 : M.redacted) != null && j.hidden) && /* @__PURE__ */ o(s, { mb: 2, children: [
298
- /* @__PURE__ */ i(
299
- X,
300
- {
301
- control: /* @__PURE__ */ i(
302
- f,
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
- name: "redacted",
305
- control: c,
306
- render: ({ field: { value: t, ...n } }) => /* @__PURE__ */ i(Z, { checked: !!t, ...n })
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
- label: "Redacted"
310
- }
311
- ),
312
- e.fieldOptions && ((q = e.fieldOptions.redacted) == null ? void 0 : q.helperText)
313
- ] }),
314
- !((U = (G = e.fieldOptions) == null ? void 0 : G.contentEncrypted) != null && U.hidden) && /* @__PURE__ */ o(s, { mb: 2, children: [
315
- /* @__PURE__ */ i(
316
- X,
317
- {
318
- control: /* @__PURE__ */ i(
319
- f,
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
- name: "contentEncrypted",
322
- control: c,
323
- render: ({ field: { value: t, ...n } }) => /* @__PURE__ */ i(Z, { checked: !!t, ...n })
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
- label: "Content Encrypted"
327
- }
328
- ),
329
- e.fieldOptions && ((H = e.fieldOptions.contentEncrypted) == null ? void 0 : H.helperText)
330
- ] })
409
+ e.fieldOptions && (($ = e.fieldOptions.contentEncrypted) == null ? void 0 : $.helperText)
410
+ ] })
411
+ }
412
+ )
331
413
  ] }),
332
- !(($ = (J = e.fieldOptions) == null ? void 0 : J.disseminationList) != null && $.hidden) && /* @__PURE__ */ i(
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: c,
340
- render: ({ field: { value: t, onChange: n }, fieldState: a }) => {
341
- const d = t || [], l = (r) => {
342
- n(r);
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__ */ i(
426
+ return /* @__PURE__ */ t(
345
427
  Ce,
346
428
  {
347
- selectedIds: d,
429
+ selectedIds: o,
348
430
  memberedGroups: e.memberedGroups,
349
431
  showError: !!a.error,
350
432
  variant: e.inputVariant,
351
- onChange: l
433
+ labelPosition: e.labelPosition,
434
+ onChange: r
352
435
  }
353
436
  );
354
437
  }
355
438
  }
356
439
  ),
357
- !((Y = (Q = e.fieldOptions) == null ? void 0 : Q.securityLevelId) != null && Y.hidden) && /* @__PURE__ */ i(s, { mt: 2, children: /* @__PURE__ */ i(
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: c,
365
- render: ({ field: { value: t, onChange: n }, fieldState: a }) => {
366
- var l, r;
367
- const d = (m) => {
368
- n(m);
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__ */ i(
371
- Ie,
453
+ return /* @__PURE__ */ t(
454
+ Le,
372
455
  {
373
- value: t || 0,
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: (l = e.securityLevelConfig) == null ? void 0 : l.templateKeys,
379
- templateType: (r = e.securityLevelConfig) == null ? void 0 : r.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
- onChange: d
465
+ labelPosition: e.labelPosition,
466
+ onChange: o
383
467
  }
384
468
  );
385
469
  }
386
470
  }
387
471
  ) }),
388
- /* @__PURE__ */ o(s, { display: "flex", justifyContent: "space-between", mt: 3, children: [
389
- /* @__PURE__ */ i(
390
- T,
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: se,
480
+ onClick: me,
397
481
  children: "Cancel"
398
482
  }
399
483
  ),
400
- /* @__PURE__ */ o(s, { children: [
401
- e.onRemove !== void 0 && /* @__PURE__ */ i(
402
- T,
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((t, n) => /* @__PURE__ */ i(
414
- T,
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: t.icon,
504
+ startIcon: i.icon,
421
505
  sx: { ml: 1, textTransform: "none" },
422
- onClick: t.onClick,
423
- children: t.label
506
+ onClick: i.onClick,
507
+ children: i.label
424
508
  },
425
- n
426
- )) : /* @__PURE__ */ i(
427
- T,
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 = u.forwardRef(Ve);
529
+ const je = h.forwardRef(pe);
446
530
  export {
447
531
  je as InstanceForm
448
532
  };