@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.
@@ -1,147 +1,147 @@
1
- import { jsx as i, jsxs as c, Fragment as Oe } from "react/jsx-runtime";
2
- import Le from "lodash";
3
- import p, { useRef as Ve } from "react";
4
- import { useForm as Se, Controller as h } from "react-hook-form";
5
- import { Box as l, Typography as y, TextField as x, FormHelperText as fe, FormGroup as Fe, FormControlLabel as ue, Checkbox as he, Button as O } from "@mui/material";
6
- import { getNestedChildrenFromMap as ke } from "../../utils/ontology.js";
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 Ee } from "../container/index.js";
9
- import { DisseminationList as Pe } from "../data-security-selectors/dissemination-list/index.js";
10
- import { SecurityLevel as Re } from "../data-security-selectors/security-level/index.js";
11
- import { i as Be, d as Ae } from "../../utils-Bq0ye5vf.js";
12
- import { TreeSelect as De } from "../tree-select/index.js";
13
- import Ne from "./components/policy-list/index.js";
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 _e from "./components/variables/index.js";
16
- const We = {
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 qe(e, pe) {
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 = Ve(null), {
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: ve,
27
+ handleSubmit: xe,
28
28
  control: f,
29
- formState: { errors: ye, isDirty: F },
29
+ formState: { errors: Te, isDirty: F },
30
30
  getValues: k,
31
31
  setValue: T,
32
- reset: ge,
32
+ reset: we,
33
33
  watch: I
34
- } = Se({
34
+ } = Ee({
35
35
  defaultValues: e.defaultValues
36
- }), a = (e == null ? void 0 : e.labelPosition) ?? "default", [be, xe] = p.useState([]), [w, E] = p.useState(), [$e, Te] = p.useState(0), we = p.useMemo(() => {
37
- const t = [];
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 || t.push(String(n.id));
40
- }), t;
39
+ n.creatable || i.push(String(n.id));
40
+ }), i;
41
41
  }, [e.mappedTemplates]);
42
42
  p.useEffect(() => {
43
43
  (async () => {
44
- const t = { ...e.defaultValues }, n = e.mappedTemplates.get(t.templateId);
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 = Le.get(t, `variables.${d.propertyId}`);
51
+ const d = r[o], s = Fe.get(i, `variables.${d.propertyId}`);
52
52
  if (s && e.keyAuth) {
53
- const u = await Be(We), g = await Ae(u, String(s));
54
- g.data && (T(`variables.${d.propertyId}`, g.data), Te((b) => b + 1));
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 C = () => {
61
- const t = k("templateId");
60
+ const O = () => {
61
+ const i = k("templateId");
62
62
  w && E(void 0);
63
- const n = ke(e.mappedTemplates);
64
- xe(n);
63
+ const n = Re(e.mappedTemplates);
64
+ Oe(n);
65
65
  for (const r of e.mappedTemplates.values())
66
- if (r.id === t) {
66
+ if (r.id === i) {
67
67
  E(r);
68
68
  break;
69
69
  }
70
70
  };
71
- p.useImperativeHandle(pe, () => ({
71
+ p.useImperativeHandle(be, () => ({
72
72
  requestSubmit() {
73
- var t;
74
- (t = V.current) == null || t.requestSubmit();
73
+ var i;
74
+ (i = V.current) == null || i.requestSubmit();
75
75
  },
76
76
  resetForm() {
77
- ge({
77
+ we({
78
78
  title: "",
79
79
  description: "",
80
80
  templateId: 0,
81
81
  variables: {}
82
- }), C();
82
+ }), O();
83
83
  },
84
- setFormValue(t, n) {
85
- T(t, n);
84
+ setFormValue(i, n) {
85
+ T(i, n);
86
86
  },
87
- getFormValue(t) {
88
- return k(t);
87
+ getFormValue(i) {
88
+ return k(i);
89
89
  },
90
90
  isDirty() {
91
91
  return F;
92
92
  },
93
- getWatchedValue(t) {
94
- return I(t);
93
+ getWatchedValue(i) {
94
+ return I(i);
95
95
  }
96
- })), p.useEffect(() => (C(), () => {
96
+ })), p.useEffect(() => (O(), () => {
97
97
  }), [e.mappedTemplates]), p.useEffect(() => {
98
98
  e.onSelectedTemplateChange && e.onSelectedTemplateChange(w);
99
99
  }, [w]);
100
- const Ie = () => {
100
+ const Ve = () => {
101
101
  if (e.onCancel) {
102
102
  e.onCancel(F);
103
103
  return;
104
104
  }
105
- }, v = (t) => {
105
+ }, v = (i) => {
106
106
  var o, d;
107
- if (!t) return;
108
- const n = (d = (o = e == null ? void 0 : e.fieldOptions) == null ? void 0 : o[t]) == null ? void 0 : d.maxChar;
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__ */ i(
111
+ return /* @__PURE__ */ t(
112
112
  m,
113
113
  {
114
114
  condition: e.variant === void 0 || e.variant === "inline",
115
- wrapper: (t) => /* @__PURE__ */ i(
116
- Ee,
115
+ wrapper: (i) => /* @__PURE__ */ t(
116
+ Be,
117
117
  {
118
118
  disableHeader: !0,
119
119
  sx: { position: "relative", overflow: "visible" },
120
- children: t
120
+ children: i
121
121
  }
122
122
  ),
123
123
  children: /* @__PURE__ */ c(
124
124
  "form",
125
125
  {
126
126
  ref: V,
127
- onSubmit: ve(e.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__ */ i(
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: (t) => /* @__PURE__ */ c(l, { display: "flex", alignItems: "center", children: [
135
- /* @__PURE__ */ i(y, { width: "32%", children: "Title *" }),
136
- /* @__PURE__ */ i(l, { width: "68%", children: t })
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__ */ i(
139
+ /* @__PURE__ */ t(
140
140
  m,
141
141
  {
142
142
  condition: a === "top",
143
143
  wrapper: L("Title", !0),
144
- children: /* @__PURE__ */ i(
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
- ...ye.title && {
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__ */ i(fe, { sx: { textAlign: "right", mt: 0.5 }, children: `${(D = I("title")) == null ? void 0 : D.length}/${v("title")}` }),
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__ */ i(
167
- m,
168
- {
169
- condition: a === "left",
170
- wrapper: (t) => /* @__PURE__ */ c(l, { display: "flex", alignItems: "center", children: [
171
- /* @__PURE__ */ i(y, { width: "32%", children: "Description" }),
172
- /* @__PURE__ */ i(l, { width: "68%", children: t })
173
- ] }),
174
- children: /* @__PURE__ */ c(l, { mb: 2, children: [
175
- /* @__PURE__ */ i(
176
- m,
177
- {
178
- condition: a === "top",
179
- wrapper: L("Description", !1),
180
- children: /* @__PURE__ */ i(
181
- x,
182
- {
183
- label: a === "default" ? "Description" : void 0,
184
- inputProps: v("description") ? { maxLength: v("description") } : void 0,
185
- placeholder: (($ = (q = e.fieldOptions) == null ? void 0 : q.description) == null ? void 0 : $.placeholder) ?? "",
186
- variant: e.inputVariant,
187
- fullWidth: !0,
188
- multiline: !0,
189
- minRows: (M = (K = e.fieldOptions) == null ? void 0 : K.description) == null ? void 0 : M.minRows,
190
- ...S("description")
191
- }
192
- )
193
- }
194
- ),
195
- v("description") && /* @__PURE__ */ i(fe, { sx: { textAlign: "right", mt: 0.5 }, children: `${(U = I("description")) == null ? void 0 : U.length}/${v(
196
- "description"
197
- )}` }),
198
- e.fieldOptions && ((j = e.fieldOptions.description) == null ? void 0 : j.helperText)
199
- ] })
200
- }
201
- ),
202
- !((H = (G = e.fieldOptions) == null ? void 0 : G.templateId) != null && H.hidden) && /* @__PURE__ */ i(
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: (t) => /* @__PURE__ */ c(l, { display: "flex", alignItems: "center", children: [
207
- /* @__PURE__ */ i(y, { width: "32%", children: "Template" }),
208
- /* @__PURE__ */ i(l, { width: "68%", children: t })
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(Fe, { sx: { mb: 2 }, children: [
211
- /* @__PURE__ */ i(
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__ */ i(
219
+ children: /* @__PURE__ */ t(
217
220
  h,
218
221
  {
219
222
  name: "templateId",
220
223
  control: f,
221
- render: ({ field: { value: t, onChange: n } }) => {
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 = t ? e.mappedTemplates.get(t) : void 0;
225
- return /* @__PURE__ */ i(
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__ */ i(
240
- De,
242
+ return /* @__PURE__ */ t(
243
+ We,
241
244
  {
242
245
  label: a === "default" ? "Template" : void 0,
243
- data: be,
244
- selected: t === 0 ? "" : [String(t)],
245
- disabled: we,
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), C();
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 && ((J = e.fieldOptions.templateId) == null ? void 0 : J.helperText)
265
+ e.fieldOptions && ((z = e.fieldOptions.templateId) == null ? void 0 : z.helperText)
263
266
  ] })
264
267
  }
265
268
  ),
266
- "aliasList" in e.defaultValues && !((Y = (Q = e.fieldOptions) == null ? void 0 : Q.aliasList) != null && Y.hidden) && /* @__PURE__ */ i(
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: t, onChange: n, ...r } }) => {
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((me) => me.trimStart())
279
+ value: s.target.value.split(",").map((he) => he.trimStart())
277
280
  }
278
281
  };
279
282
  n(b);
280
283
  };
281
- return /* @__PURE__ */ i(
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__ */ i(y, { width: "32%", children: "Alias List" }),
287
- /* @__PURE__ */ i(l, { width: "68%", children: s })
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__ */ i(
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: t,
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 && !((X = (z = e.fieldOptions) == null ? void 0 : z.appliedPolicies) != null && X.hidden) && /* @__PURE__ */ i(
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: t, onChange: n } }) => {
317
+ render: ({ field: { value: i, onChange: n } }) => {
315
318
  var r;
316
- return /* @__PURE__ */ i(
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__ */ i(y, { width: "32%", children: "Policy List" }),
322
- /* @__PURE__ */ i(l, { width: "68%", children: o })
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__ */ i(
326
- Ne,
328
+ /* @__PURE__ */ t(
329
+ qe,
327
330
  {
328
331
  policyList: e.policyList,
329
332
  labelPosition: a,
330
- value: t || void 0,
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__ */ i(
344
+ /* @__PURE__ */ t(
342
345
  h,
343
346
  {
344
347
  name: "variables",
345
348
  control: f,
346
- render: ({ field: { value: t, onChange: n } }) => /* @__PURE__ */ i(
347
- _e,
349
+ render: ({ field: { value: i, onChange: n } }) => /* @__PURE__ */ t(
350
+ $e,
348
351
  {
349
352
  template: w,
350
- value: t,
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 && !((ee = (Z = e.fieldOptions) == null ? void 0 : Z.fileInBase64) != null && ee.hidden) && /* @__PURE__ */ c(Oe, { children: [
361
- /* @__PURE__ */ i(
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: t, value: n, ...r } }) => {
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 Ce = b.target.result.split("base64,")[1];
373
- t(Ce);
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__ */ i(
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__ */ i(y, { width: "32%", children: "File to Upload" }),
385
- /* @__PURE__ */ i(l, { width: "68%", children: s })
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__ */ i(
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
- !((ie = (te = e.fieldOptions) == null ? void 0 : te.redacted) != null && ie.hidden) && /* @__PURE__ */ i(
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: (t) => /* @__PURE__ */ c(l, { display: "flex", alignItems: "center", children: [
413
- /* @__PURE__ */ i(y, { width: "32%", children: "Redacted" }),
414
- /* @__PURE__ */ i(l, { width: "68%", children: t })
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__ */ i(
418
- ue,
420
+ /* @__PURE__ */ t(
421
+ ye,
419
422
  {
420
- control: /* @__PURE__ */ i(
423
+ control: /* @__PURE__ */ t(
421
424
  h,
422
425
  {
423
426
  name: "redacted",
424
427
  control: f,
425
- render: ({ field: { value: t, ...n } }) => /* @__PURE__ */ i(he, { checked: !!t, ...n })
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 && ((ne = e.fieldOptions.redacted) == null ? void 0 : ne.helperText)
434
+ e.fieldOptions && ((de = e.fieldOptions.redacted) == null ? void 0 : de.helperText)
432
435
  ] })
433
436
  }
434
437
  ),
435
- !((ae = (le = e.fieldOptions) == null ? void 0 : le.contentEncrypted) != null && ae.hidden) && /* @__PURE__ */ i(
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: (t) => /* @__PURE__ */ c(l, { display: "flex", alignItems: "center", children: [
440
- /* @__PURE__ */ i(y, { width: "32%", children: "Content Encrypted" }),
441
- /* @__PURE__ */ i(l, { width: "68%", children: t })
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__ */ i(
445
- ue,
447
+ /* @__PURE__ */ t(
448
+ ye,
446
449
  {
447
- control: /* @__PURE__ */ i(
450
+ control: /* @__PURE__ */ t(
448
451
  h,
449
452
  {
450
453
  name: "contentEncrypted",
451
454
  control: f,
452
- render: ({ field: { value: t, ...n } }) => /* @__PURE__ */ i(he, { checked: !!t, ...n })
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 && ((de = e.fieldOptions.contentEncrypted) == null ? void 0 : de.helperText)
461
+ e.fieldOptions && ((ce = e.fieldOptions.contentEncrypted) == null ? void 0 : ce.helperText)
459
462
  ] })
460
463
  }
461
464
  )
462
465
  ] }),
463
- !((oe = (re = e.fieldOptions) == null ? void 0 : re.disseminationList) != null && oe.hidden) && /* @__PURE__ */ i(
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: t, onChange: n }, fieldState: r }) => {
472
- const o = t || [], d = (s) => {
474
+ render: ({ field: { value: i, onChange: n }, fieldState: r }) => {
475
+ const o = i || [], d = (s) => {
473
476
  n(s);
474
477
  };
475
- return /* @__PURE__ */ i(
476
- Pe,
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
- !((se = (ce = e.fieldOptions) == null ? void 0 : ce.securityLevelId) != null && se.hidden) && /* @__PURE__ */ i(l, { mt: 2, children: /* @__PURE__ */ i(
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: t, onChange: n }, fieldState: r }) => {
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__ */ i(
503
- Re,
505
+ return /* @__PURE__ */ t(
506
+ De,
504
507
  {
505
- value: t || 0,
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__ */ i(
530
- O,
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: Ie,
539
+ onClick: Ve,
537
540
  children: "Cancel"
538
541
  }
539
542
  ),
540
- /* @__PURE__ */ i(l, { sx: { flex: e.onCancel ? "none" : 1 }, children: e.customSaveButtons ? e.customSaveButtons : e.saveButtons ? e.saveButtons.map((t, n) => /* @__PURE__ */ i(
541
- O,
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: t.icon,
550
+ startIcon: i.icon,
548
551
  sx: { ml: 1, textTransform: "none" },
549
- onClick: t.onClick,
550
- children: t.label
552
+ onClick: i.onClick,
553
+ children: i.label
551
554
  },
552
555
  n
553
- )) : /* @__PURE__ */ i(
554
- O,
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 nt = p.forwardRef(qe);
576
+ const dt = p.forwardRef(Me);
574
577
  export {
575
- nt as InstanceForm
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;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hybridcore/ui",
3
3
  "description": "Hybrid Core UI Library",
4
- "version": "1.5.54",
4
+ "version": "1.5.57",
5
5
  "author": "Hybrid Core",
6
6
  "license": "ISC",
7
7
  "type": "module",