@hybridcore/ui 1.5.40 → 1.5.42

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,48 +1,51 @@
1
- import { jsxs as i, jsx as o, Fragment as h } from "react/jsx-runtime";
2
- import { Box as n, AppBar as d, Toolbar as l } from "@mui/material";
3
- import { ActionButtons as c } from "./components/action-buttons/index.js";
1
+ import { jsxs as r, jsx as o, Fragment as h } from "react/jsx-runtime";
2
+ import { Box as t, AppBar as c, Toolbar as l } from "@mui/material";
3
+ import { ActionButtons as d } from "./components/action-buttons/index.js";
4
4
  import m from "./components/viewer/index.js";
5
5
  import { useDocumentViewerLogic as g } from "./logic.js";
6
- import { SidePanelToggleButton as s, SidePanel as f } from "./styled.js";
7
- import { DoubleArrow as u } from "@mui/icons-material";
8
- const S = (r) => {
9
- const { refs: a, state: e, action: t } = g(r);
10
- return /* @__PURE__ */ i(n, { bgcolor: "#ededed", children: [
11
- /* @__PURE__ */ o(d, { color: "inherit", children: /* @__PURE__ */ i(l, { sx: { justifyContent: "space-between" }, children: [
12
- /* @__PURE__ */ o(n, { children: r.logo }),
13
- /* @__PURE__ */ o(n, {}),
14
- /* @__PURE__ */ o(n, { children: /* @__PURE__ */ o(
15
- c,
6
+ import { SidePanelToggleButton as s, SidePanel as u } from "./styled.js";
7
+ import { DoubleArrow as f } from "@mui/icons-material";
8
+ const S = (e) => {
9
+ const { refs: a, state: n, action: i } = g(e);
10
+ return /* @__PURE__ */ r(t, { bgcolor: "#ededed", children: [
11
+ /* @__PURE__ */ o(c, { color: "inherit", children: /* @__PURE__ */ r(l, { sx: { justifyContent: "space-between" }, children: [
12
+ /* @__PURE__ */ o(t, { children: e.logo }),
13
+ /* @__PURE__ */ o(t, {}),
14
+ /* @__PURE__ */ o(t, { children: /* @__PURE__ */ o(
15
+ d,
16
16
  {
17
- onBookmark: r.onBookmark,
18
- onDownload: t.onDownload,
19
- onFullScreen: t.onFullScreen,
20
- onPrint: t.onPrint
17
+ onBookmark: e.onBookmark,
18
+ onDownload: i.onDownload,
19
+ onFullScreen: i.onFullScreen,
20
+ onPrint: i.onPrint
21
21
  }
22
22
  ) })
23
23
  ] }) }),
24
24
  /* @__PURE__ */ o(l, {}),
25
- /* @__PURE__ */ o(n, { mr: `${e.rightPanelWidth}px`, sx: { transition: "all .3s" }, children: e.blob ? /* @__PURE__ */ o(m, { ref: a.viewer, data: e.blob }) : null }),
26
- r.rightPanel ? /* @__PURE__ */ i(h, { children: [
25
+ /* @__PURE__ */ r(t, { mr: `${n.rightPanelWidth}px`, sx: { transition: "all .3s" }, children: [
26
+ n.blob ? /* @__PURE__ */ o(m, { ref: a.viewer, data: n.blob }) : null,
27
+ e.customContent
28
+ ] }),
29
+ e.rightPanel ? /* @__PURE__ */ r(h, { children: [
27
30
  /* @__PURE__ */ o(
28
31
  s,
29
32
  {
30
- sx: { right: e.rightPanelWidth },
31
- onClick: t.toggleRightPanel,
33
+ sx: { right: n.rightPanelWidth },
34
+ onClick: i.toggleRightPanel,
32
35
  children: /* @__PURE__ */ o(
33
- u,
36
+ f,
34
37
  {
35
38
  sx: {
36
39
  fontSize: 14,
37
- transform: `rotate(${e.rightPanelWidth ? 0 : 180}deg)`
40
+ transform: `rotate(${n.rightPanelWidth ? 0 : 180}deg)`
38
41
  }
39
42
  }
40
43
  )
41
44
  }
42
45
  ),
43
- /* @__PURE__ */ i(f, { width: e.rightPanelWidth, right: 0, children: [
46
+ /* @__PURE__ */ r(u, { width: n.rightPanelWidth, right: 0, children: [
44
47
  /* @__PURE__ */ o(l, {}),
45
- r.rightPanel
48
+ e.rightPanel
46
49
  ] })
47
50
  ] }) : null
48
51
  ] });
@@ -1,44 +1,44 @@
1
1
  import { jsx as i, jsxs as o, Fragment as xe } from "react/jsx-runtime";
2
- import h, { useRef as Te } from "react";
2
+ import v, { useRef as Te } from "react";
3
3
  import Ie from "lodash";
4
- import { useForm as we, Controller as f } from "react-hook-form";
5
- import { getNestedChildrenFromMap as Pe } from "../../utils/ontology.js";
6
- import { i as Ce, d as Le } from "../../utils-Bq0ye5vf.js";
7
- import { ConditionalWrapper as u } from "../conditional-wrapper/index.js";
8
- import { Container as Oe } from "../container/index.js";
9
- import { Box as l, Typography as v, TextField as x, FormHelperText as de, FormGroup as Ve, FormControlLabel as re, Checkbox as oe, Button as w } from "@mui/material";
10
- import { TreeSelect as pe } from "../tree-select/index.js";
11
- import Se from "./components/policy-list/index.js";
12
- import Fe from "./components/variables/index.js";
13
- import { DisseminationList as ke } from "../data-security-selectors/dissemination-list/index.js";
14
- import { SecurityLevel as Re } from "../data-security-selectors/security-level/index.js";
15
- const Ee = {
4
+ import { useForm as we, Controller as u } from "react-hook-form";
5
+ import { getNestedChildrenFromMap as Ce } from "../../utils/ontology.js";
6
+ import { i as Le, d as Oe } from "../../utils-Bq0ye5vf.js";
7
+ import { ConditionalWrapper as h } from "../conditional-wrapper/index.js";
8
+ import { Container as Ve } from "../container/index.js";
9
+ import { Box as l, Typography as y, TextField as x, FormHelperText as re, FormGroup as Se, FormControlLabel as oe, Checkbox as ce, Button as w } from "@mui/material";
10
+ import { TreeSelect as Fe } from "../tree-select/index.js";
11
+ import ke from "./components/policy-list/index.js";
12
+ import Re from "./components/variables/index.js";
13
+ import { DisseminationList as Ee } from "../data-security-selectors/dissemination-list/index.js";
14
+ import { SecurityLevel as Pe } from "../data-security-selectors/security-level/index.js";
15
+ const Be = {
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 Be(e, ce) {
23
- var F, k, R, E, B, D, A, N, _, W, q, $, K, M, U, j, G, H, J, Q, Y, z, X, Z, ee, te, ie, ne, le;
24
- const C = Te(null), {
25
- register: L,
26
- handleSubmit: se,
27
- control: s,
28
- formState: { errors: me, isDirty: O },
29
- getValues: V,
22
+ function De(e, se) {
23
+ var R, E, P, B, D, A, N, _, W, q, $, K, M, U, j, G, H, J, Q, Y, z, X, Z, ee, te, ie, ne, le, ae;
24
+ const L = Te(null), {
25
+ register: O,
26
+ handleSubmit: me,
27
+ control: m,
28
+ formState: { errors: fe, isDirty: V },
29
+ getValues: S,
30
30
  setValue: T,
31
- reset: fe,
32
- watch: p
31
+ reset: ue,
32
+ watch: F
33
33
  } = we({
34
34
  defaultValues: e.defaultValues
35
- }), [ue, he] = h.useState([]), [I, S] = h.useState(), [De, be] = h.useState(0), ve = h.useMemo(() => {
35
+ }), c = (e == null ? void 0 : e.labelPosition) ?? "default", [he, ve] = v.useState([]), [I, k] = v.useState(), [Ae, ge] = v.useState(0), ye = v.useMemo(() => {
36
36
  const t = [];
37
37
  return e.mappedTemplates.forEach((n) => {
38
38
  n.creatable || t.push(String(n.id));
39
39
  }), t;
40
40
  }, [e.mappedTemplates]);
41
- h.useEffect(() => {
41
+ v.useEffect(() => {
42
42
  (async () => {
43
43
  const t = { ...e.defaultValues }, n = e.mappedTemplates.get(t.templateId);
44
44
  if (n) {
@@ -47,69 +47,69 @@ function Be(e, ce) {
47
47
  );
48
48
  if (d.length > 0)
49
49
  for (let r = 0; r < d.length; r++) {
50
- const a = d[r], c = Ie.get(t, `variables.${a.propertyId}`);
51
- if (c && e.keyAuth) {
52
- const m = await Ce(Ee), g = await Le(m, String(c));
53
- g.data && (T(`variables.${a.propertyId}`, g.data), be((y) => y + 1));
50
+ const a = d[r], s = Ie.get(t, `variables.${a.propertyId}`);
51
+ if (s && e.keyAuth) {
52
+ const f = await Le(Be), b = await Oe(f, String(s));
53
+ b.data && (T(`variables.${a.propertyId}`, b.data), ge((p) => p + 1));
54
54
  }
55
55
  }
56
56
  }
57
57
  })();
58
58
  }, [e.defaultValues, e.mappedTemplates, e.keyAuth]);
59
- const P = () => {
60
- const t = V("templateId");
61
- I && S(void 0);
62
- const n = Pe(e.mappedTemplates);
63
- he(n);
59
+ const C = () => {
60
+ const t = S("templateId");
61
+ I && k(void 0);
62
+ const n = Ce(e.mappedTemplates);
63
+ ve(n);
64
64
  for (const d of e.mappedTemplates.values())
65
65
  if (d.id === t) {
66
- S(d);
66
+ k(d);
67
67
  break;
68
68
  }
69
69
  };
70
- h.useImperativeHandle(ce, () => ({
70
+ v.useImperativeHandle(se, () => ({
71
71
  requestSubmit() {
72
72
  var t;
73
- (t = C.current) == null || t.requestSubmit();
73
+ (t = L.current) == null || t.requestSubmit();
74
74
  },
75
75
  resetForm() {
76
- fe({
76
+ ue({
77
77
  title: "",
78
78
  description: "",
79
79
  templateId: 0,
80
80
  variables: {}
81
- }), P();
81
+ }), C();
82
82
  },
83
83
  setFormValue(t, n) {
84
84
  T(t, n);
85
85
  },
86
86
  getFormValue(t) {
87
- return V(t);
87
+ return S(t);
88
88
  },
89
89
  isDirty() {
90
- return O;
90
+ return V;
91
91
  }
92
- })), h.useEffect(() => (P(), () => {
93
- }), [e.mappedTemplates]), h.useEffect(() => {
92
+ })), v.useEffect(() => (C(), () => {
93
+ }), [e.mappedTemplates]), v.useEffect(() => {
94
94
  e.onSelectedTemplateChange && e.onSelectedTemplateChange(I);
95
95
  }, [I]);
96
- const ge = () => {
96
+ const be = () => {
97
97
  if (e.onCancel) {
98
- e.onCancel(O);
98
+ e.onCancel(V);
99
99
  return;
100
100
  }
101
- }, b = (t) => {
101
+ }, g = (t) => {
102
102
  var r, a;
103
103
  if (!t) return;
104
104
  const n = (a = (r = e == null ? void 0 : e.fieldOptions) == null ? void 0 : r[t]) == null ? void 0 : a.maxChar;
105
105
  return n != null && !Number.isNaN(Number(n)) ? Number(n) : void 0;
106
106
  };
107
107
  return /* @__PURE__ */ i(
108
- u,
108
+ h,
109
109
  {
110
110
  condition: e.variant === void 0 || e.variant === "inline",
111
111
  wrapper: (t) => /* @__PURE__ */ i(
112
- Oe,
112
+ Ve,
113
113
  {
114
114
  disableHeader: !0,
115
115
  sx: { position: "relative", overflow: "visible" },
@@ -119,80 +119,80 @@ function Be(e, ce) {
119
119
  children: /* @__PURE__ */ o(
120
120
  "form",
121
121
  {
122
- ref: C,
123
- onSubmit: se(e.onSubmit),
122
+ ref: L,
123
+ onSubmit: me(e.onSubmit),
124
124
  style: { display: "flex", flexDirection: "column" },
125
125
  children: [
126
- !((k = (F = e.fieldOptions) == null ? void 0 : F.title) != null && k.hidden) && /* @__PURE__ */ i(
127
- u,
126
+ !((E = (R = e.fieldOptions) == null ? void 0 : R.title) != null && E.hidden) && /* @__PURE__ */ i(
127
+ h,
128
128
  {
129
- condition: e.labelPosition === "left",
129
+ condition: c === "left",
130
130
  wrapper: (t) => /* @__PURE__ */ o(l, { display: "flex", alignItems: "center", children: [
131
- /* @__PURE__ */ i(v, { width: "32%", children: "Title *" }),
131
+ /* @__PURE__ */ i(y, { width: "32%", children: "Title *" }),
132
132
  /* @__PURE__ */ i(l, { width: "68%", children: t })
133
133
  ] }),
134
134
  children: /* @__PURE__ */ o(l, { mb: 2, children: [
135
135
  /* @__PURE__ */ i(
136
136
  x,
137
137
  {
138
- label: e.labelPosition === "default" ? "Title *" : void 0,
138
+ label: c === "default" ? "Title *" : void 0,
139
139
  variant: e.inputVariant,
140
- inputProps: b("title") ? { maxLength: b("title") } : void 0,
140
+ inputProps: g("title") ? { maxLength: g("title") } : void 0,
141
141
  fullWidth: !0,
142
- ...L("title", { required: !0 }),
143
- ...me.title && {
142
+ ...O("title", { required: !0 }),
143
+ ...fe.title && {
144
144
  helperText: "This field is required!",
145
145
  error: !0
146
146
  }
147
147
  }
148
148
  ),
149
- b("title") && /* @__PURE__ */ i(de, { sx: { textAlign: "right", mt: 0.5 }, children: `${(R = p("title")) == null ? void 0 : R.length}/${b("title")}` }),
150
- e.fieldOptions && ((E = e.fieldOptions.title) == null ? void 0 : E.helperText)
149
+ g("title") && /* @__PURE__ */ i(re, { sx: { textAlign: "right", mt: 0.5 }, children: `${(P = F("title")) == null ? void 0 : P.length}/${g("title")}` }),
150
+ e.fieldOptions && ((B = e.fieldOptions.title) == null ? void 0 : B.helperText)
151
151
  ] })
152
152
  }
153
153
  ),
154
- !((D = (B = e.fieldOptions) == null ? void 0 : B.description) != null && D.hidden) && /* @__PURE__ */ i(
155
- u,
154
+ !((A = (D = e.fieldOptions) == null ? void 0 : D.description) != null && A.hidden) && /* @__PURE__ */ i(
155
+ h,
156
156
  {
157
- condition: e.labelPosition === "left",
157
+ condition: c === "left",
158
158
  wrapper: (t) => /* @__PURE__ */ o(l, { display: "flex", alignItems: "center", children: [
159
- /* @__PURE__ */ i(v, { width: "32%", children: "Description" }),
159
+ /* @__PURE__ */ i(y, { width: "32%", children: "Description" }),
160
160
  /* @__PURE__ */ i(l, { width: "68%", children: t })
161
161
  ] }),
162
162
  children: /* @__PURE__ */ o(l, { mb: 2, children: [
163
163
  /* @__PURE__ */ i(
164
164
  x,
165
165
  {
166
- label: e.labelPosition === "default" ? "Description" : void 0,
167
- inputProps: b("description") ? { maxLength: b("description") } : void 0,
166
+ label: c === "default" ? "Description" : void 0,
167
+ inputProps: g("description") ? { maxLength: g("description") } : void 0,
168
168
  variant: e.inputVariant,
169
169
  fullWidth: !0,
170
170
  multiline: !0,
171
- minRows: (N = (A = e.fieldOptions) == null ? void 0 : A.description) == null ? void 0 : N.minRows,
172
- ...L("description")
171
+ minRows: (_ = (N = e.fieldOptions) == null ? void 0 : N.description) == null ? void 0 : _.minRows,
172
+ ...O("description")
173
173
  }
174
174
  ),
175
- b("description") && /* @__PURE__ */ i(de, { sx: { textAlign: "right", mt: 0.5 }, children: `${(_ = p("description")) == null ? void 0 : _.length}/${b(
175
+ g("description") && /* @__PURE__ */ i(re, { sx: { textAlign: "right", mt: 0.5 }, children: `${(W = F("description")) == null ? void 0 : W.length}/${g(
176
176
  "description"
177
177
  )}` }),
178
- e.fieldOptions && ((W = e.fieldOptions.description) == null ? void 0 : W.helperText)
178
+ e.fieldOptions && ((q = e.fieldOptions.description) == null ? void 0 : q.helperText)
179
179
  ] })
180
180
  }
181
181
  ),
182
- !(($ = (q = e.fieldOptions) == null ? void 0 : q.templateId) != null && $.hidden) && /* @__PURE__ */ i(
183
- u,
182
+ !((K = ($ = e.fieldOptions) == null ? void 0 : $.templateId) != null && K.hidden) && /* @__PURE__ */ i(
183
+ h,
184
184
  {
185
- condition: e.labelPosition === "left",
185
+ condition: c === "left",
186
186
  wrapper: (t) => /* @__PURE__ */ o(l, { display: "flex", alignItems: "center", children: [
187
- /* @__PURE__ */ i(v, { width: "32%", children: "Template" }),
187
+ /* @__PURE__ */ i(y, { width: "32%", children: "Template" }),
188
188
  /* @__PURE__ */ i(l, { width: "68%", children: t })
189
189
  ] }),
190
- children: /* @__PURE__ */ o(Ve, { sx: { mb: 2 }, children: [
190
+ children: /* @__PURE__ */ o(Se, { sx: { mb: 2 }, children: [
191
191
  /* @__PURE__ */ i(
192
- f,
192
+ u,
193
193
  {
194
194
  name: "templateId",
195
- control: s,
195
+ control: m,
196
196
  render: ({ field: { value: t, onChange: n } }) => {
197
197
  var d, r;
198
198
  if ((r = (d = e.fieldOptions) == null ? void 0 : d.templateId) != null && r.disabled) {
@@ -210,58 +210,58 @@ function Be(e, ce) {
210
210
  );
211
211
  }
212
212
  return /* @__PURE__ */ i(
213
- pe,
213
+ Fe,
214
214
  {
215
- label: e.labelPosition === "default" ? "Template" : void 0,
216
- data: ue,
215
+ label: c === "default" ? "Template" : void 0,
216
+ data: he,
217
217
  selected: t === 0 ? "" : [String(t)],
218
- disabled: ve,
218
+ disabled: ye,
219
219
  variant: e.inputVariant,
220
- onChange: (a, c) => {
221
- const m = {
220
+ onChange: (a, s) => {
221
+ const f = {
222
222
  target: {
223
- value: c ? Number(a) : 0
223
+ value: s ? Number(a) : 0
224
224
  }
225
225
  };
226
- n(m), P();
226
+ n(f), C();
227
227
  }
228
228
  }
229
229
  );
230
230
  }
231
231
  }
232
232
  ),
233
- e.fieldOptions && ((K = e.fieldOptions.templateId) == null ? void 0 : K.helperText)
233
+ e.fieldOptions && ((M = e.fieldOptions.templateId) == null ? void 0 : M.helperText)
234
234
  ] })
235
235
  }
236
236
  ),
237
- "aliasList" in e.defaultValues && !((U = (M = e.fieldOptions) == null ? void 0 : M.aliasList) != null && U.hidden) && /* @__PURE__ */ i(
238
- f,
237
+ "aliasList" in e.defaultValues && !((j = (U = e.fieldOptions) == null ? void 0 : U.aliasList) != null && j.hidden) && /* @__PURE__ */ i(
238
+ u,
239
239
  {
240
240
  name: "aliasList",
241
- control: s,
241
+ control: m,
242
242
  render: ({ field: { value: t, onChange: n, ...d } }) => {
243
243
  var a;
244
- const r = (c) => {
245
- const y = {
244
+ const r = (s) => {
245
+ const p = {
246
246
  target: {
247
- value: c.target.value.split(",").map((ae) => ae.trimStart())
247
+ value: s.target.value.split(",").map((de) => de.trimStart())
248
248
  }
249
249
  };
250
- n(y);
250
+ n(p);
251
251
  };
252
252
  return /* @__PURE__ */ i(
253
- u,
253
+ h,
254
254
  {
255
- condition: e.labelPosition === "left",
256
- wrapper: (c) => /* @__PURE__ */ o(l, { display: "flex", alignItems: "center", children: [
257
- /* @__PURE__ */ i(v, { width: "32%", children: "Alias List" }),
258
- /* @__PURE__ */ i(l, { width: "68%", children: c })
255
+ condition: c === "left",
256
+ wrapper: (s) => /* @__PURE__ */ o(l, { display: "flex", alignItems: "center", children: [
257
+ /* @__PURE__ */ i(y, { width: "32%", children: "Alias List" }),
258
+ /* @__PURE__ */ i(l, { width: "68%", children: s })
259
259
  ] }),
260
260
  children: /* @__PURE__ */ o(l, { mb: 2, children: [
261
261
  /* @__PURE__ */ i(
262
262
  x,
263
263
  {
264
- label: e.labelPosition === "default" ? "Alias List" : void 0,
264
+ label: c === "default" ? "Alias List" : void 0,
265
265
  variant: e.inputVariant,
266
266
  fullWidth: !0,
267
267
  value: t,
@@ -277,27 +277,27 @@ function Be(e, ce) {
277
277
  }
278
278
  }
279
279
  ),
280
- "appliedPolicies" in e.defaultValues && !((G = (j = e.fieldOptions) == null ? void 0 : j.appliedPolicies) != null && G.hidden) && /* @__PURE__ */ i(
281
- f,
280
+ "appliedPolicies" in e.defaultValues && !((H = (G = e.fieldOptions) == null ? void 0 : G.appliedPolicies) != null && H.hidden) && /* @__PURE__ */ i(
281
+ u,
282
282
  {
283
283
  name: "appliedPolicies",
284
- control: s,
284
+ control: m,
285
285
  render: ({ field: { value: t, onChange: n } }) => {
286
286
  var d;
287
287
  return /* @__PURE__ */ i(
288
- u,
288
+ h,
289
289
  {
290
- condition: e.labelPosition === "left",
290
+ condition: c === "left",
291
291
  wrapper: (r) => /* @__PURE__ */ o(l, { display: "flex", alignItems: "center", children: [
292
- /* @__PURE__ */ i(v, { width: "32%", children: "Policy List" }),
292
+ /* @__PURE__ */ i(y, { width: "32%", children: "Policy List" }),
293
293
  /* @__PURE__ */ i(l, { width: "68%", children: r })
294
294
  ] }),
295
295
  children: /* @__PURE__ */ o(l, { mb: 2, children: [
296
296
  /* @__PURE__ */ i(
297
- Se,
297
+ ke,
298
298
  {
299
299
  policyList: e.policyList,
300
- labelPosition: e.labelPosition,
300
+ labelPosition: c,
301
301
  value: t || void 0,
302
302
  onChange: n
303
303
  }
@@ -310,57 +310,57 @@ function Be(e, ce) {
310
310
  }
311
311
  ),
312
312
  /* @__PURE__ */ i(
313
- f,
313
+ u,
314
314
  {
315
315
  name: "variables",
316
- control: s,
316
+ control: m,
317
317
  render: ({ field: { value: t, onChange: n } }) => /* @__PURE__ */ i(
318
- Fe,
318
+ Re,
319
319
  {
320
320
  template: I,
321
321
  value: t,
322
322
  mapboxAccessToken: e.mapboxAccessToken,
323
323
  variant: e.inputVariant,
324
- labelPosition: e.labelPosition,
324
+ labelPosition: c,
325
325
  fieldOptions: e.fieldOptions,
326
326
  onChange: n
327
327
  }
328
328
  )
329
329
  }
330
330
  ),
331
- "fileInBase64" in e.defaultValues && !((J = (H = e.fieldOptions) == null ? void 0 : H.fileInBase64) != null && J.hidden) && /* @__PURE__ */ o(xe, { children: [
331
+ "fileInBase64" in e.defaultValues && !((Q = (J = e.fieldOptions) == null ? void 0 : J.fileInBase64) != null && Q.hidden) && /* @__PURE__ */ o(xe, { children: [
332
332
  /* @__PURE__ */ i(
333
- f,
333
+ u,
334
334
  {
335
335
  name: "fileInBase64",
336
- control: s,
336
+ control: m,
337
337
  render: ({ field: { onChange: t, value: n, ...d } }) => {
338
338
  var a;
339
- const r = (c) => {
340
- if (c.target.files) {
341
- const m = new FileReader();
342
- m.onload = async (y) => {
343
- const ye = y.target.result.split("base64,")[1];
344
- t(ye);
339
+ const r = (s) => {
340
+ if (s.target.files) {
341
+ const f = new FileReader();
342
+ f.onload = async (p) => {
343
+ const pe = p.target.result.split("base64,")[1];
344
+ t(pe);
345
345
  };
346
- const g = c.target.files[0];
347
- T("originalFileName", g.name), T("contentType", g.type), m.readAsDataURL(g);
346
+ const b = s.target.files[0];
347
+ T("originalFileName", b.name), T("contentType", b.type), f.readAsDataURL(b);
348
348
  }
349
349
  };
350
350
  return /* @__PURE__ */ i(
351
- u,
351
+ h,
352
352
  {
353
- condition: e.labelPosition === "left",
354
- wrapper: (c) => /* @__PURE__ */ o(l, { display: "flex", alignItems: "center", children: [
355
- /* @__PURE__ */ i(v, { width: "32%", children: "File to Upload" }),
356
- /* @__PURE__ */ i(l, { width: "68%", children: c })
353
+ condition: c === "left",
354
+ wrapper: (s) => /* @__PURE__ */ o(l, { display: "flex", alignItems: "center", children: [
355
+ /* @__PURE__ */ i(y, { width: "32%", children: "File to Upload" }),
356
+ /* @__PURE__ */ i(l, { width: "68%", children: s })
357
357
  ] }),
358
358
  children: /* @__PURE__ */ o(l, { mb: 2, children: [
359
359
  /* @__PURE__ */ i(
360
360
  x,
361
361
  {
362
362
  type: "file",
363
- label: e.labelPosition === "default" ? "File to Upload" : void 0,
363
+ label: c === "default" ? "File to Upload" : void 0,
364
364
  variant: e.inputVariant,
365
365
  fullWidth: !0,
366
366
  helperText: "Select a file to upload",
@@ -376,102 +376,102 @@ function Be(e, ce) {
376
376
  }
377
377
  }
378
378
  ),
379
- !((Y = (Q = e.fieldOptions) == null ? void 0 : Q.redacted) != null && Y.hidden) && /* @__PURE__ */ i(
380
- u,
379
+ !((z = (Y = e.fieldOptions) == null ? void 0 : Y.redacted) != null && z.hidden) && /* @__PURE__ */ i(
380
+ h,
381
381
  {
382
- condition: e.labelPosition === "left",
382
+ condition: c === "left",
383
383
  wrapper: (t) => /* @__PURE__ */ o(l, { display: "flex", alignItems: "center", children: [
384
- /* @__PURE__ */ i(v, { width: "32%", children: "Redacted" }),
384
+ /* @__PURE__ */ i(y, { width: "32%", children: "Redacted" }),
385
385
  /* @__PURE__ */ i(l, { width: "68%", children: t })
386
386
  ] }),
387
387
  children: /* @__PURE__ */ o(l, { mb: 2, children: [
388
388
  /* @__PURE__ */ i(
389
- re,
389
+ oe,
390
390
  {
391
391
  control: /* @__PURE__ */ i(
392
- f,
392
+ u,
393
393
  {
394
394
  name: "redacted",
395
- control: s,
396
- render: ({ field: { value: t, ...n } }) => /* @__PURE__ */ i(oe, { checked: !!t, ...n })
395
+ control: m,
396
+ render: ({ field: { value: t, ...n } }) => /* @__PURE__ */ i(ce, { checked: !!t, ...n })
397
397
  }
398
398
  ),
399
- label: e.labelPosition === "default" ? "Redacted" : void 0
399
+ label: c === "default" ? "Redacted" : void 0
400
400
  }
401
401
  ),
402
- e.fieldOptions && ((z = e.fieldOptions.redacted) == null ? void 0 : z.helperText)
402
+ e.fieldOptions && ((X = e.fieldOptions.redacted) == null ? void 0 : X.helperText)
403
403
  ] })
404
404
  }
405
405
  ),
406
- !((Z = (X = e.fieldOptions) == null ? void 0 : X.contentEncrypted) != null && Z.hidden) && /* @__PURE__ */ i(
407
- u,
406
+ !((ee = (Z = e.fieldOptions) == null ? void 0 : Z.contentEncrypted) != null && ee.hidden) && /* @__PURE__ */ i(
407
+ h,
408
408
  {
409
- condition: e.labelPosition === "left",
409
+ condition: c === "left",
410
410
  wrapper: (t) => /* @__PURE__ */ o(l, { display: "flex", alignItems: "center", children: [
411
- /* @__PURE__ */ i(v, { width: "32%", children: "Content Encrypted" }),
411
+ /* @__PURE__ */ i(y, { width: "32%", children: "Content Encrypted" }),
412
412
  /* @__PURE__ */ i(l, { width: "68%", children: t })
413
413
  ] }),
414
414
  children: /* @__PURE__ */ o(l, { mb: 2, children: [
415
415
  /* @__PURE__ */ i(
416
- re,
416
+ oe,
417
417
  {
418
418
  control: /* @__PURE__ */ i(
419
- f,
419
+ u,
420
420
  {
421
421
  name: "contentEncrypted",
422
- control: s,
423
- render: ({ field: { value: t, ...n } }) => /* @__PURE__ */ i(oe, { checked: !!t, ...n })
422
+ control: m,
423
+ render: ({ field: { value: t, ...n } }) => /* @__PURE__ */ i(ce, { checked: !!t, ...n })
424
424
  }
425
425
  ),
426
- label: e.labelPosition === "default" ? "Content Encrypted" : void 0
426
+ label: c === "default" ? "Content Encrypted" : void 0
427
427
  }
428
428
  ),
429
- e.fieldOptions && ((ee = e.fieldOptions.contentEncrypted) == null ? void 0 : ee.helperText)
429
+ e.fieldOptions && ((te = e.fieldOptions.contentEncrypted) == null ? void 0 : te.helperText)
430
430
  ] })
431
431
  }
432
432
  )
433
433
  ] }),
434
- !((ie = (te = e.fieldOptions) == null ? void 0 : te.disseminationList) != null && ie.hidden) && /* @__PURE__ */ i(
435
- f,
434
+ !((ne = (ie = e.fieldOptions) == null ? void 0 : ie.disseminationList) != null && ne.hidden) && /* @__PURE__ */ i(
435
+ u,
436
436
  {
437
437
  name: "disseminationList",
438
438
  rules: {
439
439
  required: !0
440
440
  },
441
- control: s,
441
+ control: m,
442
442
  render: ({ field: { value: t, onChange: n }, fieldState: d }) => {
443
- const r = t || [], a = (c) => {
444
- n(c);
443
+ const r = t || [], a = (s) => {
444
+ n(s);
445
445
  };
446
446
  return /* @__PURE__ */ i(
447
- ke,
447
+ Ee,
448
448
  {
449
449
  selectedIds: r,
450
450
  memberedGroups: e.memberedGroups,
451
451
  showError: !!d.error,
452
452
  variant: e.inputVariant,
453
- labelPosition: e.labelPosition,
453
+ labelPosition: c,
454
454
  onChange: a
455
455
  }
456
456
  );
457
457
  }
458
458
  }
459
459
  ),
460
- !((le = (ne = e.fieldOptions) == null ? void 0 : ne.securityLevelId) != null && le.hidden) && /* @__PURE__ */ i(l, { mt: 2, children: /* @__PURE__ */ i(
461
- f,
460
+ !((ae = (le = e.fieldOptions) == null ? void 0 : le.securityLevelId) != null && ae.hidden) && /* @__PURE__ */ i(l, { mt: 2, children: /* @__PURE__ */ i(
461
+ u,
462
462
  {
463
463
  name: "securityLevelId",
464
464
  rules: {
465
465
  required: !0
466
466
  },
467
- control: s,
467
+ control: m,
468
468
  render: ({ field: { value: t, onChange: n }, fieldState: d }) => {
469
- var a, c;
470
- const r = (m) => {
471
- n(m);
469
+ var a, s;
470
+ const r = (f) => {
471
+ n(f);
472
472
  };
473
473
  return /* @__PURE__ */ i(
474
- Re,
474
+ Pe,
475
475
  {
476
476
  value: t || 0,
477
477
  ontologyId: e.ontologyId,
@@ -479,10 +479,10 @@ function Be(e, ce) {
479
479
  securityLevels: e.securityLevels,
480
480
  minLevelId: e.minSecurityLevel,
481
481
  templateKeys: (a = e.securityLevelConfig) == null ? void 0 : a.templateKeys,
482
- templateType: (c = e.securityLevelConfig) == null ? void 0 : c.templateType,
482
+ templateType: (s = e.securityLevelConfig) == null ? void 0 : s.templateType,
483
483
  showError: !!d.error,
484
484
  variant: e.inputVariant,
485
- labelPosition: e.labelPosition,
485
+ labelPosition: c,
486
486
  onChange: r
487
487
  }
488
488
  );
@@ -497,7 +497,7 @@ function Be(e, ce) {
497
497
  variant: "text",
498
498
  disabled: e.loading,
499
499
  sx: { textTransform: "none" },
500
- onClick: ge,
500
+ onClick: be,
501
501
  children: "Cancel"
502
502
  }
503
503
  ),
@@ -546,7 +546,7 @@ function Be(e, ce) {
546
546
  }
547
547
  );
548
548
  }
549
- const Ye = h.forwardRef(Be);
549
+ const ze = v.forwardRef(De);
550
550
  export {
551
- Ye as InstanceForm
551
+ ze as InstanceForm
552
552
  };
package/dist/main.d.ts CHANGED
@@ -218,6 +218,7 @@ declare interface DocumentViewerProps {
218
218
  data: string; // Base64
219
219
  logo: default_2.ReactNode;
220
220
  title: string;
221
+ customContent?: default_2.ReactNode;
221
222
  rightPanel?: default_2.ReactNode;
222
223
  rightPanelWidth?: number;
223
224
  onBookmark(): void;
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.40",
4
+ "version": "1.5.42",
5
5
  "author": "Hybrid Core",
6
6
  "license": "ISC",
7
7
  "type": "module",