@hybridcore/ui 1.3.5 → 1.3.7

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.
@@ -3,7 +3,7 @@ import "@mui/material";
3
3
  import "./styled.js";
4
4
  import "@mui/icons-material";
5
5
  import "../../../../../hooks/useToggle.js";
6
- import { C as l } from "../../../../../index-B3Oj04nl.js";
6
+ import { C as l } from "../../../../../index-CJVcedWy.js";
7
7
  import "react";
8
8
  import "lodash";
9
9
  import "dayjs";
@@ -1,13 +1,22 @@
1
- import { styled as i, Box as n, Button as r } from "@mui/material";
2
- const p = i(n)(({ theme: o, variant: t }) => ({
1
+ import { styled as i, Box as r, Button as n } from "@mui/material";
2
+ const p = i(r)(({ theme: o, variant: t }) => ({
3
3
  position: "relative",
4
4
  width: "100%",
5
+ boxSizing: "border-box",
5
6
  ...t === "outlined" ? {
6
7
  border: "1px solid",
7
- padding: "2.5px 60px 2.5px 2.5px",
8
+ padding: "10px 60px 10px 10px",
8
9
  borderRadius: o.spacing(0.5),
9
10
  "& .MuiButton-root": {
10
- margin: "7px 8px"
11
+ margin: "14px 8px"
12
+ },
13
+ "& .MuiTypography-root": {
14
+ position: "absolute",
15
+ top: -15,
16
+ left: 10,
17
+ paddingLeft: 4,
18
+ paddingRight: 4,
19
+ backgroundColor: o.palette.background.default
11
20
  }
12
21
  } : {
13
22
  borderBottom: "1px solid",
@@ -17,7 +26,7 @@ const p = i(n)(({ theme: o, variant: t }) => ({
17
26
  "&:hover": {
18
27
  borderColor: o.palette.action.active
19
28
  }
20
- })), d = i(n)(({ theme: o }) => ({
29
+ })), d = i(r)(({ theme: o }) => ({
21
30
  minHeight: 33,
22
31
  whiteSpace: "normal",
23
32
  "& .MuiChip-root": {
@@ -27,7 +36,7 @@ const p = i(n)(({ theme: o, variant: t }) => ({
27
36
  "& .MuiChip-root:first-of-type": {
28
37
  marginLeft: 0
29
38
  }
30
- })), e = i(r)(({ theme: o, variant: t }) => ({
39
+ })), e = i(n)(({ theme: o, variant: t }) => ({
31
40
  position: "absolute",
32
41
  top: 0,
33
42
  right: 0,
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "lodash";
3
3
  import "dayjs";
4
- import { V as b } from "../../../../../index-B3Oj04nl.js";
4
+ import { V as b } from "../../../../../index-CJVcedWy.js";
5
5
  import "@mui/material";
6
6
  import "@mui/icons-material";
7
7
  import "../../../../geometry-picker/index.js";
@@ -1,39 +1,41 @@
1
1
  import { jsx as t, Fragment as i } from "react/jsx-runtime";
2
- import l from "react";
3
- import { V as m } from "../../../../../index-B3Oj04nl.js";
4
- import d from "lodash";
5
- function h({
2
+ import f from "react";
3
+ import { V as m } from "../../../../../index-CJVcedWy.js";
4
+ import c from "lodash";
5
+ function b({
6
6
  template: o,
7
7
  value: n,
8
8
  mapboxAccessToken: a,
9
- onChange: s
9
+ variant: s = "outlined",
10
+ onChange: u
10
11
  }) {
11
12
  if (o === void 0) return /* @__PURE__ */ t(i, {});
12
- const p = l.useMemo(() => {
13
+ const l = f.useMemo(() => {
13
14
  let r = o.properties.filter((e) => e.visible);
14
- return r = d.orderBy(r, "id"), r;
15
- }, [o]), u = (r) => {
15
+ return r = c.orderBy(r, "id"), r;
16
+ }, [o]), p = (r) => {
16
17
  const e = {
17
18
  target: {
18
19
  value: { ...n, ...r }
19
20
  }
20
21
  };
21
- s(e);
22
+ u(e);
22
23
  };
23
- return /* @__PURE__ */ t(i, { children: p.map((r, e) => {
24
- const f = n[r.propertyId];
24
+ return /* @__PURE__ */ t(i, { children: l.map((r, e) => {
25
+ const d = n[r.propertyId];
25
26
  return /* @__PURE__ */ t(
26
27
  m,
27
28
  {
28
29
  property: r,
29
- value: f,
30
+ value: d,
30
31
  mapboxAccessToken: a,
31
- onChange: u
32
+ variant: s,
33
+ onChange: p
32
34
  },
33
35
  e
34
36
  );
35
37
  }) });
36
38
  }
37
39
  export {
38
- h as default
40
+ b as default
39
41
  };
@@ -6,7 +6,7 @@ import { getNestedChildrenFromMap as N } from "../../../utils/ontology.js";
6
6
  import { i as G, d as K } from "../../../utils-Bq0ye5vf.js";
7
7
  import { ConditionalWrapper as O } from "../../conditional-wrapper/index.js";
8
8
  import { Container as U } from "../../container/index.js";
9
- import { TextField as h, FormGroup as j, FormControl as q, InputLabel as H, Select as Y, MenuItem as J, FormControlLabel as L, Checkbox as S, Box as T, Button as g } from "@mui/material";
9
+ import { TextField as h, FormGroup as j, FormControl as q, InputLabel as H, Select as Y, MenuItem as J, FormControlLabel as L, Checkbox as V, Box as T, Button as y } from "@mui/material";
10
10
  import { TreeSelect as $ } from "../../tree-select/index.js";
11
11
  import Q from "./components/policy-list/index.js";
12
12
  import X from "./components/variables/index.js";
@@ -25,18 +25,18 @@ const ee = {
25
25
  "BINARY",
26
26
  "OTHER"
27
27
  ];
28
- function ae(e, F) {
28
+ function ae(e, S) {
29
29
  const {
30
30
  register: C,
31
31
  handleSubmit: E,
32
32
  control: d,
33
- formState: { errors: V },
33
+ formState: { errors: F },
34
34
  getValues: x,
35
- setValue: p,
35
+ setValue: v,
36
36
  reset: k
37
37
  } = M({
38
38
  defaultValues: e.defaultValues
39
- }), [R, _] = m.useState([]), [v, I] = m.useState(), [ne, w] = m.useState(0), B = m.useMemo(() => {
39
+ }), [R, _] = m.useState([]), [b, I] = m.useState(), [ne, w] = m.useState(0), B = m.useMemo(() => {
40
40
  const t = [];
41
41
  return e.mappedTemplates.forEach((n) => {
42
42
  n.creatable || t.push(String(n.id));
@@ -48,22 +48,22 @@ function ae(e, F) {
48
48
  const n = e.mappedTemplates.get(t.templateId);
49
49
  if (n) {
50
50
  const l = n.properties.filter(
51
- (r) => r.privacyPreservationMethod === "ENCRYPTION"
51
+ (i) => i.privacyPreservationMethod === "ENCRYPTION"
52
52
  );
53
53
  if (l.length > 0)
54
- for (let r = 0; r < l.length; r++) {
55
- const i = l[r], o = W.get(t, `variables.${i.propertyId}`);
54
+ for (let i = 0; i < l.length; i++) {
55
+ const r = l[i], o = W.get(t, `variables.${r.propertyId}`);
56
56
  if (o && e.keyAuth) {
57
57
  const c = await G(ee), u = await K(c, o);
58
- u.data && (p(`variables.${i.propertyId}`, u.data), w((b) => b + 1));
58
+ u.data && (v(`variables.${r.propertyId}`, u.data), w((g) => g + 1));
59
59
  }
60
60
  }
61
61
  }
62
62
  })();
63
63
  }, [e.defaultValues, e.mappedTemplates, e.keyAuth]);
64
- const y = () => {
64
+ const p = () => {
65
65
  const t = x("templateId");
66
- v && I(void 0);
66
+ b && I(void 0);
67
67
  const n = N(e.mappedTemplates);
68
68
  _(n);
69
69
  for (let l of e.mappedTemplates.values())
@@ -72,25 +72,25 @@ function ae(e, F) {
72
72
  break;
73
73
  }
74
74
  };
75
- m.useImperativeHandle(F, () => ({
75
+ m.useImperativeHandle(S, () => ({
76
76
  resetForm() {
77
77
  k({
78
78
  title: "",
79
79
  description: "",
80
80
  templateId: 0,
81
81
  variables: {}
82
- }), y();
82
+ }), p();
83
83
  },
84
84
  setFormValue(t, n) {
85
- p(t, n);
85
+ v(t, n);
86
86
  },
87
87
  getFormValue(t) {
88
88
  return x(t);
89
89
  }
90
- })), m.useEffect(() => (y(), () => {
90
+ })), m.useEffect(() => (p(), () => {
91
91
  }), [e.mappedTemplates]), m.useEffect(() => {
92
- e.onSelectedTemplateChange && e.onSelectedTemplateChange(v);
93
- }, [v]);
92
+ e.onSelectedTemplateChange && e.onSelectedTemplateChange(b);
93
+ }, [b]);
94
94
  const A = () => {
95
95
  if (e.onCancel) {
96
96
  e.onCancel();
@@ -114,11 +114,11 @@ function ae(e, F) {
114
114
  h,
115
115
  {
116
116
  label: "Title *",
117
- variant: "standard",
117
+ variant: e.inputVariant,
118
118
  fullWidth: !0,
119
119
  sx: { mb: 2 },
120
120
  ...C("title", { required: !0 }),
121
- ...V.title && {
121
+ ...F.title && {
122
122
  helperText: "This field is required!",
123
123
  error: !0
124
124
  }
@@ -128,7 +128,7 @@ function ae(e, F) {
128
128
  h,
129
129
  {
130
130
  label: "Description",
131
- variant: "standard",
131
+ variant: e.inputVariant,
132
132
  fullWidth: !0,
133
133
  multiline: !0,
134
134
  sx: { mb: 2 },
@@ -147,7 +147,7 @@ function ae(e, F) {
147
147
  h,
148
148
  {
149
149
  label: "Template",
150
- variant: "standard",
150
+ variant: e.inputVariant,
151
151
  fullWidth: !0,
152
152
  disabled: !0,
153
153
  value: l == null ? void 0 : l.name,
@@ -162,13 +162,14 @@ function ae(e, F) {
162
162
  data: R,
163
163
  selected: t === 0 ? "" : [String(t)],
164
164
  disabled: B,
165
- onChange: (l, r) => {
166
- const i = {
165
+ variant: e.inputVariant,
166
+ onChange: (l, i) => {
167
+ const r = {
167
168
  target: {
168
- value: r ? Number(l) : 0
169
+ value: i ? Number(l) : 0
169
170
  }
170
171
  };
171
- n(i), y();
172
+ n(r), p();
172
173
  }
173
174
  }
174
175
  );
@@ -180,26 +181,29 @@ function ae(e, F) {
180
181
  {
181
182
  name: "aliasList",
182
183
  control: d,
183
- render: ({ field: { value: t, onChange: n, ...l } }) => /* @__PURE__ */ a(
184
- h,
185
- {
186
- label: "Alias List",
187
- variant: "standard",
188
- fullWidth: !0,
189
- value: t,
190
- sx: { mb: 2 },
191
- helperText: "Add list values with the comma (,) separated string",
192
- onChange: (i) => {
193
- const u = {
194
- target: {
195
- value: i.target.value.split(",").map((b) => b.trimStart())
196
- }
197
- };
198
- n(u);
199
- },
200
- ...l
201
- }
202
- )
184
+ render: ({ field: { value: t, onChange: n, ...l } }) => {
185
+ const i = (r) => {
186
+ const u = {
187
+ target: {
188
+ value: r.target.value.split(",").map((g) => g.trimStart())
189
+ }
190
+ };
191
+ n(u);
192
+ };
193
+ return /* @__PURE__ */ a(
194
+ h,
195
+ {
196
+ label: "Alias List",
197
+ variant: e.inputVariant,
198
+ fullWidth: !0,
199
+ value: t,
200
+ sx: { mb: 2 },
201
+ helperText: "Add list values with the comma (,) separated string",
202
+ onChange: i,
203
+ ...l
204
+ }
205
+ );
206
+ }
203
207
  }
204
208
  ),
205
209
  "appliedPolicies" in e.defaultValues && /* @__PURE__ */ a(
@@ -225,9 +229,10 @@ function ae(e, F) {
225
229
  render: ({ field: { value: t, onChange: n } }) => /* @__PURE__ */ a(
226
230
  X,
227
231
  {
228
- template: v,
232
+ template: b,
229
233
  value: t,
230
234
  mapboxAccessToken: "",
235
+ variant: e.inputVariant,
231
236
  onChange: n
232
237
  }
233
238
  )
@@ -239,30 +244,33 @@ function ae(e, F) {
239
244
  {
240
245
  name: "fileInBase64",
241
246
  control: d,
242
- render: ({ field: { value: t, onChange: n, ...l } }) => /* @__PURE__ */ a(
243
- h,
244
- {
245
- type: "file",
246
- label: "File to Upload",
247
- variant: "standard",
248
- fullWidth: !0,
249
- sx: { mb: 2 },
250
- helperText: "Select a file to upload",
251
- InputLabelProps: { shrink: !0 },
252
- onChange: (i) => {
253
- if (i.target.files) {
254
- const o = new FileReader();
255
- o.onload = async (u) => {
256
- const D = u.target.result.split("base64,")[1];
257
- n(D);
258
- };
259
- const c = i.target.files[0];
260
- p("originalFileName", c.name), p("contentType", c.type), o.readAsDataURL(c);
261
- }
262
- },
263
- ...l
264
- }
265
- )
247
+ render: ({ field: { value: t, onChange: n, ...l } }) => {
248
+ const i = (r) => {
249
+ if (r.target.files) {
250
+ const o = new FileReader();
251
+ o.onload = async (u) => {
252
+ const D = u.target.result.split("base64,")[1];
253
+ n(D);
254
+ };
255
+ const c = r.target.files[0];
256
+ v("originalFileName", c.name), v("contentType", c.type), o.readAsDataURL(c);
257
+ }
258
+ };
259
+ return /* @__PURE__ */ a(
260
+ h,
261
+ {
262
+ type: "file",
263
+ label: "File to Upload",
264
+ variant: e.inputVariant,
265
+ fullWidth: !0,
266
+ sx: { mb: 2 },
267
+ helperText: "Select a file to upload",
268
+ InputLabelProps: { shrink: !0 },
269
+ onChange: i,
270
+ ...l
271
+ }
272
+ );
273
+ }
266
274
  }
267
275
  ),
268
276
  /* @__PURE__ */ a(
@@ -270,25 +278,28 @@ function ae(e, F) {
270
278
  {
271
279
  name: "type",
272
280
  control: d,
273
- render: ({ field: { value: t, onChange: n } }) => /* @__PURE__ */ f(
274
- q,
275
- {
276
- fullWidth: !0,
277
- sx: {
278
- mb: 2
279
- },
280
- variant: "standard",
281
- children: [
282
- /* @__PURE__ */ a(H, { children: "Type" }),
283
- /* @__PURE__ */ a(Y, { value: t, onChange: (r) => {
284
- const {
285
- target: { value: i }
286
- } = r;
287
- n(i);
288
- }, children: te.map((r) => /* @__PURE__ */ a(J, { value: r, children: r }, r)) })
289
- ]
290
- }
291
- )
281
+ render: ({ field: { value: t, onChange: n } }) => {
282
+ const l = (i) => {
283
+ const {
284
+ target: { value: r }
285
+ } = i;
286
+ n(r);
287
+ };
288
+ return /* @__PURE__ */ f(
289
+ q,
290
+ {
291
+ fullWidth: !0,
292
+ sx: {
293
+ mb: 2
294
+ },
295
+ variant: e.inputVariant,
296
+ children: [
297
+ /* @__PURE__ */ a(H, { children: "Type" }),
298
+ /* @__PURE__ */ a(Y, { value: t, onChange: l, children: te.map((i) => /* @__PURE__ */ a(J, { value: i, children: i }, i)) })
299
+ ]
300
+ }
301
+ );
302
+ }
292
303
  }
293
304
  ),
294
305
  /* @__PURE__ */ a(
@@ -299,7 +310,7 @@ function ae(e, F) {
299
310
  {
300
311
  name: "redacted",
301
312
  control: d,
302
- render: ({ field: { value: t, ...n } }) => /* @__PURE__ */ a(S, { checked: !!t, ...n })
313
+ render: ({ field: { value: t, ...n } }) => /* @__PURE__ */ a(V, { checked: !!t, ...n })
303
314
  }
304
315
  ),
305
316
  label: "Redacted",
@@ -314,7 +325,7 @@ function ae(e, F) {
314
325
  {
315
326
  name: "contentEncrypted",
316
327
  control: d,
317
- render: ({ field: { value: t, ...n } }) => /* @__PURE__ */ a(S, { checked: !!t, ...n })
328
+ render: ({ field: { value: t, ...n } }) => /* @__PURE__ */ a(V, { checked: !!t, ...n })
318
329
  }
319
330
  ),
320
331
  label: "Content Encrypted",
@@ -331,16 +342,17 @@ function ae(e, F) {
331
342
  },
332
343
  control: d,
333
344
  render: ({ field: { value: t, onChange: n }, fieldState: l }) => {
334
- const r = t || [], i = (o) => {
345
+ const i = t || [], r = (o) => {
335
346
  n(o);
336
347
  };
337
348
  return /* @__PURE__ */ a(
338
349
  z,
339
350
  {
340
- selectedIds: r,
351
+ selectedIds: i,
341
352
  memberedGroups: e.memberedGroups,
342
353
  showError: !!l.error,
343
- onChange: i
354
+ variant: e.inputVariant,
355
+ onChange: r
344
356
  }
345
357
  );
346
358
  }
@@ -355,8 +367,8 @@ function ae(e, F) {
355
367
  },
356
368
  control: d,
357
369
  render: ({ field: { value: t, onChange: n }, fieldState: l }) => {
358
- var i, o;
359
- const r = (c) => {
370
+ var r, o;
371
+ const i = (c) => {
360
372
  n(c);
361
373
  };
362
374
  return /* @__PURE__ */ a(
@@ -367,10 +379,11 @@ function ae(e, F) {
367
379
  appRoles: e.appRoles,
368
380
  securityLevels: e.securityLevels,
369
381
  minLevelId: e.minSecurityLevel,
370
- templateKeys: (i = e.securityLevelConfig) == null ? void 0 : i.templateKeys,
382
+ templateKeys: (r = e.securityLevelConfig) == null ? void 0 : r.templateKeys,
371
383
  templateType: (o = e.securityLevelConfig) == null ? void 0 : o.templateType,
372
384
  showError: !!l.error,
373
- onChange: r
385
+ variant: e.inputVariant,
386
+ onChange: i
374
387
  }
375
388
  );
376
389
  }
@@ -378,7 +391,7 @@ function ae(e, F) {
378
391
  ) }),
379
392
  /* @__PURE__ */ f(T, { display: "flex", justifyContent: "space-between", mt: 3, children: [
380
393
  /* @__PURE__ */ a(
381
- g,
394
+ y,
382
395
  {
383
396
  color: "primary",
384
397
  variant: "text",
@@ -390,7 +403,7 @@ function ae(e, F) {
390
403
  ),
391
404
  /* @__PURE__ */ f(T, { children: [
392
405
  e.onRemove !== void 0 && /* @__PURE__ */ a(
393
- g,
406
+ y,
394
407
  {
395
408
  type: "button",
396
409
  color: "error",
@@ -402,7 +415,7 @@ function ae(e, F) {
402
415
  }
403
416
  ),
404
417
  e.saveButtons ? e.saveButtons.map((t, n) => /* @__PURE__ */ a(
405
- g,
418
+ y,
406
419
  {
407
420
  type: "submit",
408
421
  color: "primary",
@@ -415,7 +428,7 @@ function ae(e, F) {
415
428
  },
416
429
  n
417
430
  )) : /* @__PURE__ */ a(
418
- g,
431
+ y,
419
432
  {
420
433
  type: "submit",
421
434
  color: "primary",
@@ -431,7 +444,7 @@ function ae(e, F) {
431
444
  }
432
445
  );
433
446
  }
434
- const ge = m.forwardRef(ae);
447
+ const ye = m.forwardRef(ae);
435
448
  export {
436
- ge as InstanceForm
449
+ ye as InstanceForm
437
450
  };
@@ -3089,7 +3089,7 @@ const po = ({
3089
3089
  memberedGroups: n,
3090
3090
  selectedIds: e,
3091
3091
  showError: i = !1,
3092
- variant: u = "standart",
3092
+ variant: u = "outlined",
3093
3093
  onChange: t
3094
3094
  }) => {
3095
3095
  const [a, r] = te(
@@ -3171,7 +3171,7 @@ const po = ({
3171
3171
  control: (l) => ({
3172
3172
  ...l,
3173
3173
  boxShadow: "none",
3174
- ...u === "standart" && {
3174
+ ...u === "standard" && {
3175
3175
  border: "none",
3176
3176
  borderBottom: "1px solid",
3177
3177
  borderRadius: 0,
@@ -3182,12 +3182,18 @@ const po = ({
3182
3182
  valueContainer: (l) => ({
3183
3183
  ...l,
3184
3184
  fontSize: "1rem",
3185
- ...u === "standart" ? { paddingLeft: 0 } : {
3186
- padding: "6px 0px 3px 8px"
3185
+ ...u === "standard" ? { paddingLeft: 0 } : {
3186
+ // padding: "6px 0px 3px 8px",
3187
+ padding: "9px 14px",
3188
+ minHeight: 55
3187
3189
  },
3188
3190
  ...i && { color: "#c00" }
3189
3191
  }),
3190
- multiValueRemove: (l, c) => c.data.isFixed ? { ...l, display: "none" } : l
3192
+ multiValueRemove: (l, c) => c.data.isFixed ? { ...l, display: "none" } : l,
3193
+ multiValue: (l) => ({
3194
+ ...l,
3195
+ padding: 5
3196
+ })
3191
3197
  }
3192
3198
  }
3193
3199
  ),