@hybridcore/ui 1.5.87 → 1.5.89

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.
Files changed (50) hide show
  1. package/README.md +65 -2
  2. package/dist/{FormControlLabel-DzNokgFD.js → FormControlLabel-BrdX4R71.js} +1 -1
  3. package/dist/{Input-B7ry6o4t.js → Input-CoIrGZAh.js} +1 -1
  4. package/dist/{InputLabel-rrSJo8M_.js → InputLabel-CBuAYyuT.js} +163 -162
  5. package/dist/{OutlinedInput-BDK6qOwW.js → OutlinedInput-B-iZoc9l.js} +1 -1
  6. package/dist/{Select-jjAc5JX1.js → Select-t3ewnSdf.js} +3 -3
  7. package/dist/{TextField-Bf46COnQ.js → TextField-BQ8a50fA.js} +4 -4
  8. package/dist/components/charts/candlestick/logic.js +6 -6
  9. package/dist/components/charts/candlestick/styled.js +1 -1
  10. package/dist/components/charts/highlighting-line-data/logic.js +1 -1
  11. package/dist/components/charts/highlighting-line-data/styled.js +1 -1
  12. package/dist/components/data-security-selectors/dissemination-list/index.js +652 -742
  13. package/dist/components/data-security-selectors/dissemination-list/logic.js +62 -0
  14. package/dist/components/data-security-selectors/dissemination-list/styled.js +88 -0
  15. package/dist/components/date-time-picker/index.js +57 -94
  16. package/dist/components/date-time-picker/logic.js +70 -0
  17. package/dist/components/date-time-picker/styled.js +83 -0
  18. package/dist/components/geometry-picker/index.js +45 -43
  19. package/dist/components/instance-form/components/composite-list/index.js +1 -1
  20. package/dist/components/instance-form/components/variable/index.js +5 -5
  21. package/dist/components/instance-form/components/variables/index.js +1 -1
  22. package/dist/components/metric-card/MetricChart.js +210 -192
  23. package/dist/components/metric-card/index.js +101 -76
  24. package/dist/components/metric-card/logic.js +142 -65
  25. package/dist/components/metric-card/styled.js +69 -46
  26. package/dist/components/paginated-list/logic.js +13 -13
  27. package/dist/components/paginated-list/styled.js +12 -12
  28. package/dist/components/profile-card/logic.js +5 -5
  29. package/dist/components/profile-card/styled.js +4 -4
  30. package/dist/components/property-mapping/index.js +1 -1
  31. package/dist/components/range-selector/components/composite-list-range/index.js +1 -1
  32. package/dist/components/range-selector/components/date-range/index.js +1 -1
  33. package/dist/components/range-selector/components/number-range/index.js +38 -35
  34. package/dist/components/range-selector/components/string-range/index.js +15 -14
  35. package/dist/components/range-selector/index.js +1 -1
  36. package/dist/components/search-input/index.js +2 -2
  37. package/dist/components/template-form/components/property-list/index.js +1 -1
  38. package/dist/components/template-form/components/property-list/property-list-form.js +5 -5
  39. package/dist/components/template-form/components/recognition-property-list/recognition-property-list-form.js +3 -3
  40. package/dist/components/template-form/index.js +3 -3
  41. package/dist/components/template-property-filters/property.js +4 -4
  42. package/dist/components/tree-select/index.js +52 -50
  43. package/dist/components/widget/index.js +4 -0
  44. package/dist/components/widget/styled.js +38 -0
  45. package/dist/{index-MMaYBAn0.js → index-CGNxsLVm.js} +6 -6
  46. package/dist/{index-NNOChRJ7.js → index-SpeaLUQD.js} +2 -2
  47. package/dist/main.d.ts +397 -122
  48. package/dist/main.js +14 -12
  49. package/dist/{property-list-form-BvnaooEW.js → property-list-form-C5hcK2y2.js} +4 -4
  50. package/package.json +4 -1
@@ -1,31 +1,31 @@
1
- import { useThemeProps as D } from "@mui/material";
1
+ import { useThemeProps as E } from "@mui/material";
2
2
  import { useState as g } from "react";
3
- const _ = (l) => {
4
- const i = D({ props: l, name: "MuiPaginatedList" }), {
5
- title: u,
3
+ const T = (l) => {
4
+ const i = E({ props: l, name: "HCPaginatedList" }), {
5
+ title: m,
6
6
  data: a = [],
7
7
  payload: e,
8
- totalCount: m,
8
+ totalCount: u,
9
9
  onChange: t,
10
10
  onItemClick: w,
11
11
  sx: d,
12
12
  ...h
13
- } = i, [L, p] = g(0), [f, C] = g(5), [b, P] = g([]), r = (e == null ? void 0 : e.pageNumber) !== void 0 ? e.pageNumber : L, n = (e == null ? void 0 : e.rows) !== void 0 ? e.rows : f, v = (s, o) => {
13
+ } = i, [C, p] = g(0), [L, f] = g(5), [b, P] = g([]), r = (e == null ? void 0 : e.pageNumber) !== void 0 ? e.pageNumber : C, n = (e == null ? void 0 : e.rows) !== void 0 ? e.rows : L, v = (s, o) => {
14
14
  p(o), t && t({ ...e, pageNumber: o, rows: n });
15
15
  }, x = (s) => {
16
16
  const o = parseInt(s.target.value, 10);
17
- C(o), p(0), t && t({ ...e, pageNumber: 0, rows: o });
17
+ f(o), p(0), t && t({ ...e, pageNumber: 0, rows: o });
18
18
  }, N = (s) => (o) => {
19
19
  o.stopPropagation(), P((c) => [...c, s]);
20
20
  }, R = (s) => (o) => {
21
- o.stopPropagation(), P((c) => c.filter((k) => k !== s));
22
- }, I = t ? m || 0 : a.length, M = t ? a : a.slice(r * n, (r + 1) * n), S = {
21
+ o.stopPropagation(), P((c) => c.filter((D) => D !== s));
22
+ }, I = t ? u || 0 : a.length, S = t ? a : a.slice(r * n, (r + 1) * n), k = {
23
23
  ...i
24
24
  };
25
25
  return {
26
- title: u,
26
+ title: m,
27
27
  data: a,
28
- displayData: M,
28
+ displayData: S,
29
29
  count: I,
30
30
  page: r,
31
31
  rowsPerPage: n,
@@ -35,11 +35,11 @@ const _ = (l) => {
35
35
  readMore: N,
36
36
  showLess: R,
37
37
  onItemClick: w,
38
- ownerState: S,
38
+ ownerState: k,
39
39
  sx: d,
40
40
  other: h
41
41
  };
42
42
  };
43
43
  export {
44
- _ as usePaginatedListLogic
44
+ T as usePaginatedListLogic
45
45
  };
@@ -1,17 +1,17 @@
1
- import { styled as t, Card as e, CardHeader as a, CardContent as n, List as o } from "@mui/material";
2
- const s = t(e, {
3
- name: "MuiPaginatedList",
1
+ import { styled as t, Card as i, CardHeader as a, CardContent as n, List as o } from "@mui/material";
2
+ const s = t(i, {
3
+ name: "HCPaginatedList",
4
4
  slot: "Root"
5
5
  })(() => ({
6
6
  display: "flex",
7
7
  flexDirection: "column",
8
8
  height: "100%"
9
9
  })), r = t(a, {
10
- name: "MuiPaginatedList",
10
+ name: "HCPaginatedList",
11
11
  slot: "Header"
12
- })(({ theme: i }) => ({
13
- padding: i.spacing(3),
14
- paddingBottom: i.spacing(2),
12
+ })(({ theme: e }) => ({
13
+ padding: e.spacing(3),
14
+ paddingBottom: e.spacing(2),
15
15
  "& .MuiCardHeader-title": {
16
16
  fontSize: "1rem",
17
17
  fontWeight: 500
@@ -20,7 +20,7 @@ const s = t(e, {
20
20
  fontSize: ".875rem"
21
21
  }
22
22
  })), l = t(n, {
23
- name: "MuiPaginatedList",
23
+ name: "HCPaginatedList",
24
24
  slot: "Content"
25
25
  })(() => ({
26
26
  padding: "0px !important",
@@ -29,16 +29,16 @@ const s = t(e, {
29
29
  flex: 1,
30
30
  overflow: "hidden"
31
31
  })), g = t(o, {
32
- name: "MuiPaginatedList",
32
+ name: "HCPaginatedList",
33
33
  slot: "List"
34
34
  })(() => ({
35
35
  flex: 1,
36
36
  overflowY: "auto"
37
37
  })), p = t("div", {
38
- name: "MuiPaginatedList",
38
+ name: "HCPaginatedList",
39
39
  slot: "Pagination"
40
- })(({ theme: i }) => ({
41
- borderTop: `1px solid ${i.palette.divider}`
40
+ })(({ theme: e }) => ({
41
+ borderTop: `1px solid ${e.palette.divider}`
42
42
  }));
43
43
  export {
44
44
  l as PaginatedListContent,
@@ -1,10 +1,10 @@
1
1
  import { useThemeProps as g } from "@mui/material";
2
2
  import { useMemo as n } from "react";
3
- import { getTemplateHierarchy as M } from "../../utils/ontology.js";
4
- const $ = (c) => {
5
- const a = g({ props: c, name: "MuiProfileCard" }), { instance: t, templates: e, sx: m, ...i } = a, l = t.profileImageUrl, o = e.get(t.template.id), f = o == null ? void 0 : o.icon, h = n(() => {
3
+ import { getTemplateHierarchy as C } from "../../utils/ontology.js";
4
+ const P = (c) => {
5
+ const a = g({ props: c, name: "HCProfileCard" }), { instance: t, templates: e, sx: m, ...i } = a, l = t.profileImageUrl, o = e.get(t.template.id), f = o == null ? void 0 : o.icon, h = n(() => {
6
6
  const r = e.get(t.template.id);
7
- return r ? M(e, r) : [];
7
+ return r ? C(e, r) : [];
8
8
  }, [e, t.template.id]), u = n(() => {
9
9
  const r = /* @__PURE__ */ new Map();
10
10
  return e && e.forEach((s) => {
@@ -29,5 +29,5 @@ const $ = (c) => {
29
29
  };
30
30
  };
31
31
  export {
32
- $ as useProfileCardLogic
32
+ P as useProfileCardLogic
33
33
  };
@@ -1,6 +1,6 @@
1
1
  import { styled as e, Container as i, Box as a } from "@mui/material";
2
2
  const d = e(i, {
3
- name: "MuiProfileCard",
3
+ name: "HCProfileCard",
4
4
  slot: "Root",
5
5
  overridesResolver: (r, o) => o.root
6
6
  })(({ theme: r }) => ({
@@ -12,7 +12,7 @@ const d = e(i, {
12
12
  boxShadow: r.shadows[1],
13
13
  backgroundColor: r.palette.background.paper
14
14
  })), l = e("img", {
15
- name: "MuiProfileCard",
15
+ name: "HCProfileCard",
16
16
  slot: "Image",
17
17
  overridesResolver: (r, o) => o.image
18
18
  })(({ theme: r }) => ({
@@ -21,7 +21,7 @@ const d = e(i, {
21
21
  height: 200,
22
22
  marginBottom: r.spacing(2)
23
23
  })), t = e(a, {
24
- name: "MuiProfileCard",
24
+ name: "HCProfileCard",
25
25
  slot: "Hierarchy",
26
26
  overridesResolver: (r, o) => o.hierarchy
27
27
  })(({ theme: r }) => ({
@@ -29,7 +29,7 @@ const d = e(i, {
29
29
  marginBottom: r.spacing(2),
30
30
  textAlign: "left"
31
31
  })), n = e(a, {
32
- name: "MuiProfileCard",
32
+ name: "HCProfileCard",
33
33
  slot: "Variables",
34
34
  overridesResolver: (r, o) => o.variables
35
35
  })(({ theme: r }) => ({
@@ -5,7 +5,7 @@ import { DataGrid as fe } from "@mui/x-data-grid";
5
5
  import { useState as G, useEffect as ue } from "react";
6
6
  import h from "lodash";
7
7
  import { d as ye } from "../../ol-lGwSyEIV.js";
8
- import { V as he } from "../../index-MMaYBAn0.js";
8
+ import { V as he } from "../../index-CGNxsLVm.js";
9
9
  import { RangeSelector as me } from "../range-selector/index.js";
10
10
  const $e = ({
11
11
  open: F,
@@ -3,7 +3,7 @@ import { Box as f, TextField as u } from "@mui/material";
3
3
  import x from "../number-range/index.js";
4
4
  import I from "../string-range/index.js";
5
5
  import C from "../geometry-range/index.js";
6
- import { D as c } from "../../../../index-NNOChRJ7.js";
6
+ import { D as c } from "../../../../index-SpeaLUQD.js";
7
7
  function j({
8
8
  value: n,
9
9
  innerType: e,
@@ -3,7 +3,7 @@ import "@mui/material";
3
3
  import "@mui/icons-material";
4
4
  import "dayjs";
5
5
  import "../../../../hooks/useToggle.js";
6
- import { D as e } from "../../../../index-NNOChRJ7.js";
6
+ import { D as e } from "../../../../index-SpeaLUQD.js";
7
7
  export {
8
8
  e as default
9
9
  };
@@ -1,80 +1,83 @@
1
- import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
- import { Box as n, TextField as d, FormControl as L, InputLabel as V, Select as v, MenuItem as c } from "@mui/material";
3
- import { useState as h } from "react";
4
- import y from "lodash";
5
- function z({ value: t, onChange: i }) {
6
- const [u, p] = h(
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import { Box as r, TextField as u, FormControl as V, InputLabel as y, Select as C, MenuItem as h } from "@mui/material";
3
+ import { useState as p } from "react";
4
+ import I from "lodash";
5
+ function j({ value: t, onChange: i, variant: s = "outlined" }) {
6
+ const [o, x] = p(
7
7
  "discreteList" in t && t.discreteList.length > 0 ? "list" : "range"
8
- ), [x, f] = h(
8
+ ), [f, b] = p(
9
9
  "discreteList" in t ? t.discreteList.join(",") : ""
10
- ), b = (l) => {
11
- p(l.target.value), l.target.value === "list" ? i({ discreteList: [] }) : i({ minValue: "", maxValue: "" });
12
- }, g = (l) => {
13
- const a = l.target.value, r = y.trimEnd(a, ",").split(",").filter((m) => m).map((m) => Number(m.trimStart()));
14
- f(a), i({
15
- discreteList: r
10
+ ), g = (l) => {
11
+ x(l.target.value), l.target.value === "list" ? i({ discreteList: [] }) : i({ minValue: "", maxValue: "" });
12
+ }, L = (l) => {
13
+ const a = l.target.value, d = I.trimEnd(a, ",").split(",").filter((m) => m).map((m) => Number(m.trimStart()));
14
+ b(a), i({
15
+ discreteList: d
16
16
  });
17
- }, o = (l) => {
18
- const { name: a, value: r } = l.target;
17
+ }, c = (l) => {
18
+ const { name: a, value: d } = l.target;
19
19
  i({
20
20
  ...t,
21
- [a]: Number(r)
21
+ [a]: Number(d)
22
22
  });
23
23
  };
24
- return /* @__PURE__ */ s(n, { display: "flex", width: "100%", children: [
25
- /* @__PURE__ */ e(n, { flex: 2, children: u === "list" ? /* @__PURE__ */ e(
26
- d,
24
+ return /* @__PURE__ */ n(r, { display: "flex", width: "100%", children: [
25
+ /* @__PURE__ */ e(r, { flex: 2, children: o === "list" ? /* @__PURE__ */ e(
26
+ u,
27
27
  {
28
28
  size: "small",
29
29
  fullWidth: !0,
30
- value: x,
31
- onChange: g,
30
+ variant: s,
31
+ value: f,
32
+ onChange: L,
32
33
  inputProps: {
33
34
  placeholder: "Comma separated number list"
34
35
  },
35
36
  title: "Add list values with the comma (,) separated numbers"
36
37
  }
37
- ) : /* @__PURE__ */ s(n, { display: "flex", width: "100%", children: [
38
+ ) : /* @__PURE__ */ n(r, { display: "flex", width: "100%", children: [
38
39
  /* @__PURE__ */ e(
39
- d,
40
+ u,
40
41
  {
41
42
  name: "minValue",
42
43
  label: "Min",
43
44
  type: "number",
44
45
  size: "small",
46
+ variant: s,
45
47
  fullWidth: !0,
46
48
  sx: { mr: 0.25 },
47
49
  value: t.minValue,
48
- onChange: o
50
+ onChange: c
49
51
  }
50
52
  ),
51
53
  /* @__PURE__ */ e(
52
- d,
54
+ u,
53
55
  {
54
56
  name: "maxValue",
55
57
  label: "Max",
56
58
  type: "number",
57
59
  size: "small",
60
+ variant: s,
58
61
  fullWidth: !0,
59
62
  sx: { ml: 0.25 },
60
63
  value: t.maxValue,
61
- onChange: o
64
+ onChange: c
62
65
  }
63
66
  )
64
67
  ] }) }),
65
- /* @__PURE__ */ e(n, { flex: 1, ml: 0.5, children: /* @__PURE__ */ s(L, { fullWidth: !0, size: "small", children: [
66
- /* @__PURE__ */ e(V, { id: "mode-label", children: "Input Type" }),
67
- /* @__PURE__ */ s(
68
- v,
68
+ /* @__PURE__ */ e(r, { flex: 1, ml: 0.5, children: /* @__PURE__ */ n(V, { fullWidth: !0, size: "small", variant: s, children: [
69
+ /* @__PURE__ */ e(y, { id: "mode-label", children: "Input Type" }),
70
+ /* @__PURE__ */ n(
71
+ C,
69
72
  {
70
73
  labelId: "mode-label",
71
74
  id: "mode",
72
- value: u,
75
+ value: o,
73
76
  label: "Input Type",
74
- onChange: b,
77
+ onChange: g,
75
78
  children: [
76
- /* @__PURE__ */ e(c, { value: "range", children: "Range" }),
77
- /* @__PURE__ */ e(c, { value: "list", children: "Discrete List" })
79
+ /* @__PURE__ */ e(h, { value: "range", children: "Range" }),
80
+ /* @__PURE__ */ e(h, { value: "list", children: "Discrete List" })
78
81
  ]
79
82
  }
80
83
  )
@@ -82,5 +85,5 @@ function z({ value: t, onChange: i }) {
82
85
  ] });
83
86
  }
84
87
  export {
85
- z as default
88
+ j as default
86
89
  };
@@ -1,22 +1,23 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import { TextField as u } from "@mui/material";
3
- import { useState as d } from "react";
4
- import p from "lodash";
5
- function x({ value: i, onChange: a }) {
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import { TextField as d } from "@mui/material";
3
+ import { useState as p } from "react";
4
+ import h from "lodash";
5
+ function C({ value: i, onChange: l, variant: a = "outlined" }) {
6
6
  var e;
7
- const [l, r] = d(
7
+ const [r, o] = p(
8
8
  ((e = i.listOfPossibleValues) == null ? void 0 : e.join(",")) || ""
9
9
  );
10
- return /* @__PURE__ */ m(
11
- u,
10
+ return /* @__PURE__ */ u(
11
+ d,
12
12
  {
13
13
  size: "small",
14
14
  fullWidth: !0,
15
- value: l,
16
- onChange: (o) => {
17
- const s = o.target.value, n = p.trimEnd(s, ",").split(",").filter((t) => t).map((t) => t.trimStart());
18
- r(s), a({
19
- listOfPossibleValues: n
15
+ variant: a,
16
+ value: r,
17
+ onChange: (n) => {
18
+ const s = n.target.value, m = h.trimEnd(s, ",").split(",").filter((t) => t).map((t) => t.trimStart());
19
+ o(s), l({
20
+ listOfPossibleValues: m
20
21
  });
21
22
  },
22
23
  inputProps: {
@@ -27,5 +28,5 @@ function x({ value: i, onChange: a }) {
27
28
  );
28
29
  }
29
30
  export {
30
- x as default
31
+ C as default
31
32
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as t, Fragment as a } from "react/jsx-runtime";
2
2
  import n from "lodash";
3
3
  import f from "./components/composite-list-range/index.js";
4
- import { D as g } from "../../index-NNOChRJ7.js";
4
+ import { D as g } from "../../index-SpeaLUQD.js";
5
5
  import u from "./components/geometry-range/index.js";
6
6
  import l from "./components/number-range/index.js";
7
7
  import s from "./components/string-range/index.js";
@@ -2,8 +2,8 @@ import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
2
  import k, { useState as O } from "react";
3
3
  import { Close as m, Search as u } from "@mui/icons-material";
4
4
  import { FilledInput as b, Input as R } from "@mui/material";
5
- import { F as _, I as j } from "../../InputLabel-rrSJo8M_.js";
6
- import { O as v } from "../../OutlinedInput-BDK6qOwW.js";
5
+ import { F as _, I as j } from "../../InputLabel-CBuAYyuT.js";
6
+ import { O as v } from "../../OutlinedInput-B-iZoc9l.js";
7
7
  import { I as g } from "../../InputAdornment-B7qEA4kN.js";
8
8
  import { I as t } from "../../IconButton-DJ-31-Fd.js";
9
9
  const z = ({
@@ -2,7 +2,7 @@ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
2
  import { DataGrid as d } from "@mui/x-data-grid";
3
3
  import { A as n, a as m, d as s } from "../../../../Add-CMz4N2zT.js";
4
4
  import p from "./property-list-columns.js";
5
- import { a as c } from "../../../../property-list-form-BvnaooEW.js";
5
+ import { a as c } from "../../../../property-list-form-C5hcK2y2.js";
6
6
  import u from "./property-list-logic.js";
7
7
  import { B as f } from "../../../../Box-B1AVyJ_s.js";
8
8
  import { T as y } from "../../../../Typography-D1t7XuLN.js";
@@ -1,13 +1,13 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "lodash";
4
- import { a as b } from "../../../../property-list-form-BvnaooEW.js";
4
+ import { a as b } from "../../../../property-list-form-C5hcK2y2.js";
5
5
  import "../../../../constants/index.js";
6
- import "../../../../TextField-Bf46COnQ.js";
7
- import "../../../../InputLabel-rrSJo8M_.js";
8
- import "../../../../Select-jjAc5JX1.js";
6
+ import "../../../../TextField-BQ8a50fA.js";
7
+ import "../../../../InputLabel-CBuAYyuT.js";
8
+ import "../../../../Select-t3ewnSdf.js";
9
9
  import "../../../../MenuItem-C6qlUyV3.js";
10
- import "../../../../FormControlLabel-DzNokgFD.js";
10
+ import "../../../../FormControlLabel-BrdX4R71.js";
11
11
  import "../../../../Checkbox-CrU2hpWB.js";
12
12
  import "../../../../Box-B1AVyJ_s.js";
13
13
  import "../../../../Button-eqWvpDuh.js";
@@ -2,10 +2,10 @@ import V, { jsxs as i, Fragment as S, jsx as t } from "react/jsx-runtime";
2
2
  import o from "react";
3
3
  import { r as C, i as g } from "../../../../createSvgIcon-DLPYMuH1.js";
4
4
  import { RECOGNITION_PROPERTY_OWNER_TYPE as h, RECOGNITION_PROPERTY_TYPE as T, RECOGNITION_PROPERTY_TERM_MATCH as v } from "../../../../constants/index.js";
5
- import { F as c, I as u } from "../../../../InputLabel-rrSJo8M_.js";
6
- import { S as d } from "../../../../Select-jjAc5JX1.js";
5
+ import { F as c, I as u } from "../../../../InputLabel-CBuAYyuT.js";
6
+ import { S as d } from "../../../../Select-t3ewnSdf.js";
7
7
  import { M as m } from "../../../../MenuItem-C6qlUyV3.js";
8
- import { T as b } from "../../../../TextField-Bf46COnQ.js";
8
+ import { T as b } from "../../../../TextField-BQ8a50fA.js";
9
9
  import { B as M } from "../../../../Box-B1AVyJ_s.js";
10
10
  import { B as y } from "../../../../Button-eqWvpDuh.js";
11
11
  var p = {}, q = g;
@@ -9,9 +9,9 @@ import { FormLabel as L, Button as g } from "@mui/material";
9
9
  import { getNestedChildrenFromMap as _ } from "../../utils/ontology.js";
10
10
  import { TreeSelect as w } from "../tree-select/index.js";
11
11
  import A from "./components/select-icon/index.js";
12
- import { T as m } from "../../TextField-Bf46COnQ.js";
13
- import { F as h } from "../../property-list-form-BvnaooEW.js";
14
- import { F as d } from "../../FormControlLabel-DzNokgFD.js";
12
+ import { T as m } from "../../TextField-BQ8a50fA.js";
13
+ import { F as h } from "../../property-list-form-C5hcK2y2.js";
14
+ import { F as d } from "../../FormControlLabel-BrdX4R71.js";
15
15
  import { C as c } from "../../Checkbox-CrU2hpWB.js";
16
16
  import { B as p } from "../../Box-B1AVyJ_s.js";
17
17
  function B(e, x) {
@@ -5,15 +5,15 @@ import { Typography as c, FormLabel as Y, FormGroup as D, Button as W } from "@m
5
5
  import { DatePicker as C } from "@mui/x-date-pickers";
6
6
  import f from "dayjs";
7
7
  import { B as r } from "../../Box-B1AVyJ_s.js";
8
- import { T as b } from "../../TextField-Bf46COnQ.js";
9
- import { F as O } from "../../FormControlLabel-DzNokgFD.js";
8
+ import { T as b } from "../../TextField-BQ8a50fA.js";
9
+ import { F as O } from "../../FormControlLabel-BrdX4R71.js";
10
10
  import { C as z } from "../../Checkbox-CrU2hpWB.js";
11
- import { F as B } from "../../InputLabel-rrSJo8M_.js";
11
+ import { F as B } from "../../InputLabel-CBuAYyuT.js";
12
12
  const R = ({
13
13
  property: e,
14
14
  value: a,
15
15
  size: d = "medium",
16
- variant: u,
16
+ variant: u = "outlined",
17
17
  onChange: p
18
18
  }) => {
19
19
  var I, S, y, V, M;
@@ -1,76 +1,78 @@
1
- import { jsxs as h, Fragment as W, jsx as o } from "react/jsx-runtime";
2
- import u from "react";
3
- import { TreeViewFilter as _ } from "../treeview-filter/index.js";
4
- import s from "lodash";
5
- import { flattenNestedTemplates as b } from "../../utils/ontology.js";
6
- import { F as A, I as M } from "../../InputLabel-rrSJo8M_.js";
7
- import { S as j } from "../../Select-jjAc5JX1.js";
8
- import { M as B } from "../../MenuItem-C6qlUyV3.js";
9
- import { D as k, a as w, b as L } from "../../DialogContent-CqTojymQ.js";
10
- import { B as N } from "../../Button-eqWvpDuh.js";
11
- const U = ({
12
- data: m,
13
- label: c,
1
+ import { jsxs as h, Fragment as _, jsx as n } from "react/jsx-runtime";
2
+ import m from "react";
3
+ import { TreeViewFilter as b } from "../treeview-filter/index.js";
4
+ import i from "lodash";
5
+ import { flattenNestedTemplates as A } from "../../utils/ontology.js";
6
+ import { a as M, F as j, I as k } from "../../InputLabel-CBuAYyuT.js";
7
+ import { S as B } from "../../Select-t3ewnSdf.js";
8
+ import { M as L } from "../../MenuItem-C6qlUyV3.js";
9
+ import { D as w, a as y, b as N } from "../../DialogContent-CqTojymQ.js";
10
+ import { B as R } from "../../Button-eqWvpDuh.js";
11
+ const Z = ({
12
+ data: g,
13
+ label: a,
14
14
  selected: r,
15
15
  disabled: S,
16
- idKey: i = "id",
17
- variant: g = "outlined",
16
+ idKey: d = "id",
17
+ variant: x = "outlined",
18
+ labelPosition: c = "top",
18
19
  onChange: D
19
20
  }) => {
20
- const [v, x] = u.useState(!1), [E, d] = u.useState([]), f = b(m), p = u.useMemo(() => s.isArray(r) ? r.map(
21
- (n) => f.find((e) => String(s.get(e, i)) === n)
22
- ) : [], [r, f]), T = (n, e) => {
23
- D(n, e);
24
- }, F = () => {
25
- x(!0), O();
21
+ const [E, v] = m.useState(!1), [F, f] = m.useState([]), u = A(g), p = m.useMemo(() => i.isArray(r) ? r.map(
22
+ (t) => u.find((e) => String(i.get(e, d)) === t)
23
+ ) : [], [r, u]), T = (t, e) => {
24
+ D(t, e);
25
+ }, I = () => {
26
+ v(!0), W();
26
27
  }, C = () => {
27
- x(!1);
28
- }, I = (n, e, l) => {
29
- d(l ? (a) => [
30
- ...a.filter((t) => t !== e),
28
+ v(!1);
29
+ }, O = (t, e, l) => {
30
+ f(l ? (s) => [
31
+ ...s.filter((o) => o !== e),
31
32
  e
32
- ] : (a) => a.filter((t) => t !== e));
33
- }, O = () => {
34
- const n = [];
33
+ ] : (s) => s.filter((o) => o !== e));
34
+ }, W = () => {
35
+ const t = [];
35
36
  p.length > 0 && p.forEach((e) => {
36
- const l = e == null ? void 0 : e.parentKeys, a = f.filter((t) => l == null ? void 0 : l.includes(t.templateKey)).map((t) => String(s.get(t, i)));
37
- n.push(...a);
38
- }), d(n);
37
+ const l = e == null ? void 0 : e.parentKeys, s = u.filter((o) => l == null ? void 0 : l.includes(o.templateKey)).map((o) => String(i.get(o, d)));
38
+ t.push(...s);
39
+ }), f(t);
39
40
  };
40
- return /* @__PURE__ */ h(W, { children: [
41
- /* @__PURE__ */ h(A, { variant: g, fullWidth: !0, children: [
42
- c !== void 0 && /* @__PURE__ */ o(M, { id: "select-label", children: c }),
43
- /* @__PURE__ */ o(
44
- j,
41
+ return /* @__PURE__ */ h(_, { children: [
42
+ c === "top" && a !== void 0 && /* @__PURE__ */ n(M, { sx: { display: "block", mb: 0.5 }, children: a }),
43
+ /* @__PURE__ */ h(j, { variant: x, fullWidth: !0, children: [
44
+ c === "default" && a !== void 0 && /* @__PURE__ */ n(k, { id: "select-label", children: a }),
45
+ /* @__PURE__ */ n(
46
+ B,
45
47
  {
46
- label: c,
47
- variant: g,
48
+ label: c === "default" ? a : void 0,
49
+ variant: x,
48
50
  id: "select",
49
51
  labelId: "select-label",
50
52
  value: r,
51
53
  open: !1,
52
- onOpen: F,
53
- children: p.length > 0 && p.map((n, e) => /* @__PURE__ */ o(B, { value: s.get(n, i) ?? "", children: n == null ? void 0 : n.name }, e))
54
+ onOpen: I,
55
+ children: p.length > 0 && p.map((t, e) => /* @__PURE__ */ n(L, { value: i.get(t, d) ?? "", children: t == null ? void 0 : t.name }, e))
54
56
  }
55
57
  )
56
58
  ] }),
57
- /* @__PURE__ */ h(k, { open: v, onClose: C, fullWidth: !0, maxWidth: "sm", children: [
58
- /* @__PURE__ */ o(w, { sx: { p: 1, pt: 2 }, children: /* @__PURE__ */ o(
59
- _,
59
+ /* @__PURE__ */ h(w, { open: E, onClose: C, fullWidth: !0, maxWidth: "sm", children: [
60
+ /* @__PURE__ */ n(y, { sx: { p: 1, pt: 2 }, children: /* @__PURE__ */ n(
61
+ b,
60
62
  {
61
- data: m,
62
- selected: s.isArray(r) ? r : void 0,
63
+ data: g,
64
+ selected: i.isArray(r) ? r : void 0,
63
65
  disabled: S,
64
- expanded: E,
65
- idKey: i,
66
- onExpansionToggle: I,
66
+ expanded: F,
67
+ idKey: d,
68
+ onExpansionToggle: O,
67
69
  onChange: T
68
70
  }
69
71
  ) }),
70
- /* @__PURE__ */ o(L, { children: /* @__PURE__ */ o(N, { onClick: C, variant: "contained", fullWidth: !0, children: "OK" }) })
72
+ /* @__PURE__ */ n(N, { children: /* @__PURE__ */ n(R, { onClick: C, variant: "contained", fullWidth: !0, children: "OK" }) })
71
73
  ] })
72
74
  ] });
73
75
  };
74
76
  export {
75
- U as TreeSelect
77
+ Z as TreeSelect
76
78
  };
@@ -0,0 +1,4 @@
1
+ import { Widget as r } from "./styled.js";
2
+ export {
3
+ r as Widget
4
+ };