@hybridcore/ui 1.5.33 → 1.5.35

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