@hybridcore/ui 1.5.32 → 1.5.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,82 +1,94 @@
1
- import { jsxs as a, Fragment as A, jsx as l } from "react/jsx-runtime";
2
- import { useMemo as C } from "react";
3
- import { FormControl as D, InputLabel as F, Select as $, MenuItem as j, FormHelperText as I } from "@mui/material";
1
+ import { jsx as e, jsxs as u, Fragment as A } from "react/jsx-runtime";
2
+ import { useMemo as D } from "react";
3
+ import { Box as p, Typography as F, FormControl as I, InputLabel as $, Select as j, MenuItem as v, FormHelperText as w } from "@mui/material";
4
4
  import { a as s } from "../../../helpers-DaCoWmi2.js";
5
- const q = ({
6
- ontologyId: h,
5
+ import { ConditionalWrapper as y } from "../../conditional-wrapper/index.js";
6
+ const B = ({
7
+ ontologyId: a,
7
8
  appRoles: o,
8
- templateKeys: e,
9
+ templateKeys: i,
9
10
  templateType: c,
10
- securityLevels: i,
11
- value: g,
12
- minLevel: t = 99,
13
- minLevelId: u,
11
+ securityLevels: t,
12
+ value: x,
13
+ minLevel: l = 99,
14
+ minLevelId: d,
14
15
  minLevelRoles: n,
15
- showError: d,
16
- variant: m = "outlined",
16
+ showError: m,
17
+ variant: g = "outlined",
18
+ labelPosition: f = "default",
17
19
  onChange: S
18
20
  }) => {
19
- const b = C(() => {
21
+ const C = D(() => {
20
22
  if (n && n.length > 0) {
21
23
  for (const r of n)
22
24
  if (s(r, "SUPER_ADMIN", o))
23
- return t;
25
+ return l;
24
26
  }
25
- if (e && e.length > 0 && c) {
26
- for (const r of e)
27
+ if (i && i.length > 0 && c) {
28
+ for (const r of i)
27
29
  if (s(
28
- `${h}.${c}.${r}`,
30
+ `${a}.${c}.${r}`,
29
31
  "SUPER_ADMIN",
30
32
  o
31
33
  ))
32
- return t;
34
+ return l;
33
35
  }
34
- if (u && i.length > 0) {
35
- const r = i.find(
36
- (f) => f.id === u
36
+ if (d && t.length > 0) {
37
+ const r = t.find(
38
+ (h) => h.id === d
37
39
  );
38
40
  if (r) return r.level;
39
41
  }
40
- return t;
42
+ return l;
41
43
  }, [
44
+ l,
45
+ d,
42
46
  t,
43
- u,
44
- i,
45
47
  n,
46
- e,
48
+ i,
47
49
  c,
48
50
  o,
49
- h
50
- ]), x = (r) => {
51
+ a
52
+ ]), b = (r) => {
51
53
  S(r.target.value);
52
54
  };
53
- return /* @__PURE__ */ a(A, { children: [
54
- /* @__PURE__ */ a(
55
- D,
56
- {
57
- fullWidth: !0,
58
- variant: m,
59
- error: d,
60
- sx: { ...m === "outlined" && { mt: 1 } },
61
- children: [
62
- /* @__PURE__ */ l(F, { id: "security-level-label", children: "Security Level *" }),
63
- /* @__PURE__ */ l(
64
- $,
65
- {
66
- label: "Security Level *",
67
- labelId: "security-level-label",
68
- id: "demo-simple-select",
69
- value: g,
70
- onChange: x,
71
- children: i.filter((r) => r.level <= b).map((r, f) => /* @__PURE__ */ l(j, { value: r.id, children: r.name }, f))
72
- }
73
- )
74
- ]
75
- }
76
- ),
77
- d && /* @__PURE__ */ l(I, { error: !0, children: "This field is required!" })
78
- ] });
55
+ return /* @__PURE__ */ e(
56
+ y,
57
+ {
58
+ condition: f === "left",
59
+ wrapper: (r) => /* @__PURE__ */ u(p, { display: "flex", alignItems: "center", children: [
60
+ /* @__PURE__ */ e(F, { width: "32%", children: "Security Level *" }),
61
+ /* @__PURE__ */ e(p, { width: "68%", children: r })
62
+ ] }),
63
+ children: /* @__PURE__ */ u(A, { children: [
64
+ /* @__PURE__ */ u(
65
+ I,
66
+ {
67
+ fullWidth: !0,
68
+ variant: g,
69
+ error: m,
70
+ sx: { ...g === "outlined" && { mt: 1 } },
71
+ children: [
72
+ f === "default" && /* @__PURE__ */ e($, { id: "security-level-label", children: "Security Level *" }),
73
+ /* @__PURE__ */ e(
74
+ j,
75
+ {
76
+ label: f === "default" ? "Security Level *" : void 0,
77
+ labelId: "security-level-label",
78
+ id: "demo-simple-select",
79
+ value: x,
80
+ onChange: b,
81
+ children: t.filter((r) => r.level <= C).map((r, h) => /* @__PURE__ */ e(v, { value: r.id, children: r.name }, h))
82
+ }
83
+ )
84
+ ]
85
+ }
86
+ ),
87
+ m && /* @__PURE__ */ e(w, { error: !0, children: "This field is required!" })
88
+ ] })
89
+ }
90
+ );
79
91
  };
80
92
  export {
81
- q as SecurityLevel
93
+ B as SecurityLevel
82
94
  };
@@ -3,10 +3,11 @@ 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-CdecY907.js";
6
+ import { C as s } from "../../../../index-OtGK6phq.js";
7
7
  import "react";
8
8
  import "lodash";
9
9
  import "dayjs";
10
+ import "../../../conditional-wrapper/index.js";
10
11
  export {
11
- l as default
12
+ s as default
12
13
  };
@@ -1,40 +1,41 @@
1
- import { jsxs as s, jsx as i } from "react/jsx-runtime";
2
- import { Box as p, FormLabel as c } from "@mui/material";
3
- import m from "react-select";
4
- const f = ({
5
- policyList: n,
6
- value: l = [],
1
+ import { jsxs as p, jsx as n } from "react/jsx-runtime";
2
+ import { Box as c, FormLabel as m } from "@mui/material";
3
+ import x from "react-select";
4
+ const g = ({
5
+ policyList: l,
6
+ value: i = [],
7
7
  showError: t = !1,
8
- variant: e = "standart",
9
- onChange: r
8
+ variant: o = "standart",
9
+ labelPosition: r = "default",
10
+ onChange: d
10
11
  }) => {
11
- const d = (o) => {
12
- r(o.map((a) => a.id));
12
+ const a = (e) => {
13
+ d(e.map((s) => s.id));
13
14
  };
14
- return /* @__PURE__ */ s(
15
- p,
15
+ return /* @__PURE__ */ p(
16
+ c,
16
17
  {
17
18
  sx: {
18
- ...e === "outlined" && {
19
+ ...o === "outlined" && {
19
20
  position: "relative",
20
21
  mt: 1.5,
21
22
  zIndex: 9
22
23
  }
23
24
  },
24
25
  children: [
25
- /* @__PURE__ */ i(
26
- c,
26
+ r === "default" && /* @__PURE__ */ n(
27
+ m,
27
28
  {
28
29
  sx: {
29
30
  display: "block",
30
31
  ...t && {
31
- color: (o) => o.palette.error.main
32
+ color: (e) => e.palette.error.main
32
33
  },
33
- ...e === "outlined" && {
34
+ ...o === "outlined" && {
34
35
  position: "absolute",
35
36
  fontSize: "small",
36
37
  zIndex: 1,
37
- bgcolor: (o) => o.palette.background.paper,
38
+ bgcolor: (e) => e.palette.background.paper,
38
39
  ml: 1.5,
39
40
  mt: "-9px",
40
41
  px: 0.5
@@ -43,21 +44,21 @@ const f = ({
43
44
  children: "Policy List"
44
45
  }
45
46
  ),
46
- /* @__PURE__ */ i(
47
- m,
47
+ /* @__PURE__ */ n(
48
+ x,
48
49
  {
49
- value: n.filter((o) => l.includes(o.id)),
50
- options: n,
50
+ value: l.filter((e) => i.includes(e.id)),
51
+ options: l,
51
52
  isMulti: !0,
52
- onChange: d,
53
+ onChange: a,
53
54
  menuPosition: "fixed",
54
- getOptionLabel: (o) => o.name ?? o.key,
55
- getOptionValue: (o) => String(o.id),
55
+ getOptionLabel: (e) => e.name ?? e.key,
56
+ getOptionValue: (e) => String(e.id),
56
57
  styles: {
57
- control: (o) => ({
58
- ...o,
58
+ control: (e) => ({
59
+ ...e,
59
60
  boxShadow: "none",
60
- ...e === "standart" && {
61
+ ...o === "standart" && {
61
62
  border: "none",
62
63
  borderBottom: "1px solid",
63
64
  borderRadius: 0,
@@ -65,10 +66,10 @@ const f = ({
65
66
  },
66
67
  ...t && { color: "#c00", borderColor: "#c00" }
67
68
  }),
68
- valueContainer: (o) => ({
69
- ...o,
69
+ valueContainer: (e) => ({
70
+ ...e,
70
71
  fontSize: "1rem",
71
- ...e === "standart" ? { paddingLeft: 0 } : {
72
+ ...o === "standart" ? { paddingLeft: 0 } : {
72
73
  padding: "6px 0px 3px 8px"
73
74
  },
74
75
  ...t && { color: "#c00" }
@@ -81,5 +82,5 @@ const f = ({
81
82
  );
82
83
  };
83
84
  export {
84
- f as default
85
+ g as default
85
86
  };
@@ -3,17 +3,18 @@ import "@mui/icons-material";
3
3
  import "@mui/material";
4
4
  import "dayjs";
5
5
  import "lodash";
6
- import { V as g } from "../../../../index-CdecY907.js";
6
+ import { V as h } from "../../../../index-OtGK6phq.js";
7
7
  import "../../../date-time-picker/index.js";
8
8
  import "../../../geometry-picker/index.js";
9
9
  import "../../../phone-input/index.js";
10
+ import "../../../conditional-wrapper/index.js";
11
+ import "../../../../Box-SSMZuKnS.js";
10
12
  import "../../../../TextField-CdKnj6de.js";
11
13
  import "../../../../FormControlLabel-BNT5EI0b.js";
12
14
  import "../../../../Checkbox-B0P8LhCl.js";
13
15
  import "../../../../InputLabel-ClDXuWBr.js";
14
16
  import "../../../../Select-DuyWoyoF.js";
15
17
  import "../../../../MenuItem-Lcjh1XlV.js";
16
- import "../../../../Box-SSMZuKnS.js";
17
18
  export {
18
- g as default
19
+ h as default
19
20
  };
@@ -1,34 +1,35 @@
1
- import { jsx as u, Fragment as l, jsxs as I } from "react/jsx-runtime";
2
- import _ from "react";
3
- import { V as b } from "../../../../index-CdecY907.js";
4
- import g from "lodash";
1
+ import { jsx as u, Fragment as I, jsxs as _ } from "react/jsx-runtime";
2
+ import b from "react";
3
+ import { V as g } from "../../../../index-OtGK6phq.js";
4
+ import p from "lodash";
5
5
  import { Box as i } from "@mui/material";
6
- function B({
6
+ function C({
7
7
  template: n,
8
8
  value: t,
9
9
  mapboxAccessToken: c,
10
- variant: s = "outlined",
10
+ variant: f = "outlined",
11
+ labelPosition: s = "default",
11
12
  fieldOptions: e,
12
- onChange: f
13
+ onChange: m
13
14
  }) {
14
- const m = _.useMemo(() => {
15
+ const h = b.useMemo(() => {
15
16
  let r = n == null ? void 0 : n.properties.filter((o) => o.visible);
16
- return r = g.orderBy(r, "id"), r;
17
- }, [n]), h = (r) => {
17
+ return r = p.orderBy(r, "id"), r;
18
+ }, [n]), l = (r) => {
18
19
  const o = {
19
20
  target: {
20
21
  value: { ...t, ...r }
21
22
  }
22
23
  };
23
- f(o);
24
+ m(o);
24
25
  };
25
- return n === void 0 ? /* @__PURE__ */ u(l, {}) : /* @__PURE__ */ u(i, { display: "flex", flexDirection: "column", children: m.filter((r) => {
26
+ return n === void 0 ? /* @__PURE__ */ u(I, {}) : /* @__PURE__ */ u(i, { display: "flex", flexDirection: "column", children: h.filter((r) => {
26
27
  var o;
27
28
  return e ? !((o = e[r.propertyId]) != null && o.hidden) : !0;
28
29
  }).map((r, o) => {
29
30
  var d, a;
30
31
  const x = t ? t[r.propertyId] : "";
31
- return /* @__PURE__ */ I(
32
+ return /* @__PURE__ */ _(
32
33
  i,
33
34
  {
34
35
  mb: 2,
@@ -37,14 +38,15 @@ function B({
37
38
  },
38
39
  children: [
39
40
  /* @__PURE__ */ u(
40
- b,
41
+ g,
41
42
  {
42
43
  property: r,
43
44
  value: x,
44
45
  mapboxAccessToken: c,
45
- variant: s,
46
+ variant: f,
47
+ labelPosition: s,
46
48
  fieldOptions: e,
47
- onChange: h
49
+ onChange: l
48
50
  }
49
51
  ),
50
52
  e && ((a = e[r.propertyId]) == null ? void 0 : a.helperText)
@@ -55,5 +57,5 @@ function B({
55
57
  }) });
56
58
  }
57
59
  export {
58
- B as default
60
+ C as default
59
61
  };