@hybridcore/ui 1.6.0 → 1.6.1

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 (128) hide show
  1. package/dist/{AccordionSummary-DgAwVTk8.js → AccordionSummary-CMg08YSA.js} +20 -23
  2. package/dist/{Add-DJLrrVHm.js → Add-DuVVJeQU.js} +65 -67
  3. package/dist/{ButtonBase-2bPw77UP.js → ButtonBase-sObABYY2.js} +60 -56
  4. package/dist/{Delete-CW0UZv1m.js → Delete-fBLhTHbF.js} +1 -1
  5. package/dist/{DialogContent-B3nbEbuv.js → DialogContent-CGJ7alb8.js} +8 -10
  6. package/dist/{FormControl-BLbrq4C7.js → FormControl-BCurCxRj.js} +377 -719
  7. package/dist/FormControlLabel-BkRfrhNy.js +601 -0
  8. package/dist/{IconButton-CHwRQF-g.js → IconButton-_opV1iNK.js} +26 -28
  9. package/dist/{InputAdornment-DLxWUE6H.js → InputAdornment-C7PEvvYr.js} +16 -18
  10. package/dist/InputLabel-rEwwnD4_.js +354 -0
  11. package/dist/{MenuItem-xZx_w7zA.js → MenuItem-DrE50M_p.js} +92 -70
  12. package/dist/Modal-DlB6GH-f.js +1659 -0
  13. package/dist/Paper-q9kKjAKx.js +527 -0
  14. package/dist/{Select-BgYwkZgI.js → TextField-DSDIEEKu.js} +1449 -901
  15. package/dist/{Typography-CxbneZy_.js → Typography-B-Z5Y0Xq.js} +46 -48
  16. package/dist/{capitalize-ciszXJ7R.js → capitalize-quqpGCFu.js} +1 -1
  17. package/dist/components/access/index.js +8 -15
  18. package/dist/components/access/logic.js +25 -0
  19. package/dist/components/card/index.js +158 -498
  20. package/dist/components/card/logic.js +24 -0
  21. package/dist/components/card/styled.js +226 -51
  22. package/dist/components/card-alternate/index.js +111 -139
  23. package/dist/components/card-alternate/logic.js +17 -0
  24. package/dist/components/card-alternate/styled.js +113 -19
  25. package/dist/components/collapsible-card/index.js +1 -1
  26. package/dist/components/collapsible-card/styled.js +1 -1
  27. package/dist/components/confirm/dialog.js +3 -3
  28. package/dist/components/confirm/index.js +1 -1
  29. package/dist/components/container/index.js +28 -269
  30. package/dist/components/container/logic.js +12 -0
  31. package/dist/components/container/styled.js +29 -0
  32. package/dist/components/context-menu/index.js +25 -457
  33. package/dist/components/context-menu/logic.js +14 -0
  34. package/dist/components/context-menu/styled.js +40 -0
  35. package/dist/components/data-security-selectors/security-level/index.js +36 -91
  36. package/dist/components/data-security-selectors/security-level/logic.js +73 -0
  37. package/dist/components/data-security-selectors/security-level/styled.js +47 -0
  38. package/dist/components/date-picker-with-custom-range/index.js +1 -1
  39. package/dist/components/geometry-picker/index.js +13 -12
  40. package/dist/components/instance-form/components/composite-list/index.js +1 -1
  41. package/dist/components/instance-form/components/variable/index.js +7 -9
  42. package/dist/components/instance-form/components/variables/index.js +1 -1
  43. package/dist/components/instance-form/index.js +1 -1
  44. package/dist/components/instance-hierarchy-table/index.js +32 -37
  45. package/dist/components/instance-hierarchy-table/logic.js +16 -0
  46. package/dist/components/instance-hierarchy-table/styled.js +53 -12
  47. package/dist/components/instance-table/index.js +30 -135
  48. package/dist/components/instance-table/logic.js +122 -0
  49. package/dist/components/instance-table/styled.js +53 -11
  50. package/dist/components/key-protection/index.js +45 -2
  51. package/dist/components/key-protection/logic.js +40 -0
  52. package/dist/components/key-protection/styled.js +45 -0
  53. package/dist/components/key-protection/utils.js +1 -1
  54. package/dist/components/loading/index.js +15 -9
  55. package/dist/components/loading/logic.js +15 -0
  56. package/dist/components/loading/styled.js +26 -19
  57. package/dist/components/phone-input/index.js +18 -22
  58. package/dist/components/phone-input/logic.js +14 -0
  59. package/dist/components/phone-input/styled.js +12 -4
  60. package/dist/components/property-mapping/index.js +1 -1
  61. package/dist/components/range-selector/components/composite-list-range/index.js +42 -50
  62. package/dist/components/range-selector/components/date-range/index.js +87 -4221
  63. package/dist/components/range-selector/components/geometry-range/index.js +11 -17
  64. package/dist/components/range-selector/components/number-range/index.js +48 -53
  65. package/dist/components/range-selector/components/string-range/index.js +15 -17
  66. package/dist/components/range-selector/index.js +63 -57
  67. package/dist/components/range-selector/logic.js +12 -0
  68. package/dist/components/range-selector/styled.js +4222 -0
  69. package/dist/components/template-filters/components/filter/index.js +13 -18
  70. package/dist/components/template-filters/components/tab-panel/index.js +8 -16
  71. package/dist/components/template-filters/index.js +21 -29
  72. package/dist/components/template-filters/logic.js +18 -0
  73. package/dist/components/template-filters/styled.js +44 -1
  74. package/dist/components/template-form/components/property-list/index.js +8 -8
  75. package/dist/components/template-form/components/property-list/property-list-columns.js +3 -3
  76. package/dist/components/template-form/components/property-list/property-list-form.js +8 -10
  77. package/dist/components/template-form/components/recognition-property-list/index.js +6 -6
  78. package/dist/components/template-form/components/recognition-property-list/recognition-property-list-columns.js +2 -2
  79. package/dist/components/template-form/components/recognition-property-list/recognition-property-list-form.js +8 -9
  80. package/dist/components/template-form/index.js +32 -33
  81. package/dist/components/template-property-filters/index.js +45 -95
  82. package/dist/components/template-property-filters/logic.js +27 -0
  83. package/dist/components/template-property-filters/property.js +105 -165
  84. package/dist/components/template-property-filters/styled.js +121 -20
  85. package/dist/components/tree-select/index.js +52 -67
  86. package/dist/components/tree-select/logic.js +59 -0
  87. package/dist/components/tree-select/styled.js +45 -62
  88. package/dist/components/treeview-filter/index.js +43 -65
  89. package/dist/components/treeview-filter/item/index.js +43 -42
  90. package/dist/components/treeview-filter/item-label/index.js +17 -37
  91. package/dist/components/treeview-filter/logic.js +28 -0
  92. package/dist/components/treeview-filter/styled.js +86 -0
  93. package/dist/components/uploader/index.js +532 -567
  94. package/dist/components/uploader/logic.js +74 -0
  95. package/dist/components/uploader/styled.js +93 -46
  96. package/dist/{createSvgIcon-BjpIhJ30.js → createSvgIcon-BM3-TsGy.js} +25 -26
  97. package/dist/{createSvgIcon-DrtgaibK.js → createSvgIcon-DX-SqL8M.js} +23 -25
  98. package/dist/{dialog-DcwXug9J.js → dialog-cf4HUXXl.js} +26 -27
  99. package/dist/{index-syTc6m_V.js → index-C8C3YXle.js} +92 -94
  100. package/dist/{index-CcdvNlgr.js → index-DPKUmQnz.js} +11 -13
  101. package/dist/isMuiElement-BkJ72LB3.js +26 -0
  102. package/dist/main.d.ts +734 -298
  103. package/dist/main.js +15 -15
  104. package/dist/{property-list-form-zZQfpR0X.js → property-list-form-DL_dEoNn.js} +56 -61
  105. package/dist/{createTheme-DYxDnE9u.js → styled-Bsjp3kFh.js} +232 -176
  106. package/dist/{useMobilePicker-BLg3Blg8.js → useMobilePicker-B-M3dnTn.js} +2692 -2288
  107. package/dist/{utils-Bq0ye5vf.js → utils-Cxu-fHjQ.js} +7 -7
  108. package/package.json +1 -1
  109. package/dist/Box-p6OtTUEo.js +0 -30
  110. package/dist/Button-CvE2gnly.js +0 -370
  111. package/dist/CardContent-CSHh-ZlM.js +0 -74
  112. package/dist/Checkbox-CWRMFTBp.js +0 -421
  113. package/dist/FormControlLabel-C8SPv14J.js +0 -195
  114. package/dist/List-tqElle9C.js +0 -121
  115. package/dist/ListItem-CfjsIg4B.js +0 -430
  116. package/dist/Modal-DhPpOoGB.js +0 -1299
  117. package/dist/Paper-2B03OBmZ.js +0 -169
  118. package/dist/TextField-1yCesIbH.js +0 -457
  119. package/dist/components/key-protection/menu.js +0 -85
  120. package/dist/components/treeview-filter/item/styled.js +0 -39
  121. package/dist/debounce-46wSf_lW.js +0 -15
  122. package/dist/isHostComponent-kiaBvYVo.js +0 -6
  123. package/dist/isMuiElement-CxT3_ACP.js +0 -13
  124. package/dist/listItemTextClasses-C3lndiXO.js +0 -16
  125. package/dist/styled-eZwjUruw.js +0 -12
  126. package/dist/useFormControl-CatNKXAi.js +0 -10
  127. package/dist/useThemeProps-BzzHcQyd.js +0 -58
  128. package/dist/utils-BDNynJcd.js +0 -365
@@ -0,0 +1,73 @@
1
+ import { useThemeProps as M } from "@mui/material";
2
+ import { useMemo as m } from "react";
3
+ import { b as p } from "../../../helpers-B4UL9NMD.js";
4
+ const R = (L) => {
5
+ const c = M({ props: L, name: "HCSecurityLevel" }), {
6
+ ontologyId: f,
7
+ appRoles: s,
8
+ templateKeys: o,
9
+ templateType: i,
10
+ securityLevels: t,
11
+ minLevel: n = 99,
12
+ minLevelId: a,
13
+ minLevelRoles: l,
14
+ variant: u = "outlined",
15
+ labelPosition: v = "default",
16
+ onChange: d
17
+ } = c, r = m(() => {
18
+ if (l && l.length > 0) {
19
+ for (const e of l)
20
+ if (p(e, "SUPER_ADMIN", s))
21
+ return n;
22
+ }
23
+ if (o && o.length > 0 && i) {
24
+ for (const e of o)
25
+ if (p(
26
+ `${f}.${i}.${e}`,
27
+ "SUPER_ADMIN",
28
+ s
29
+ ))
30
+ return n;
31
+ }
32
+ if (a && t.length > 0) {
33
+ const e = t.find(
34
+ (y) => y.id === a
35
+ );
36
+ if (e) return e.level;
37
+ }
38
+ return n;
39
+ }, [
40
+ n,
41
+ a,
42
+ t,
43
+ l,
44
+ o,
45
+ i,
46
+ s,
47
+ f
48
+ ]), h = m(
49
+ () => t.filter((e) => e.level <= r),
50
+ [t, r]
51
+ ), g = {
52
+ ...c,
53
+ variant: u,
54
+ labelPosition: v,
55
+ resolvedMinLevel: r
56
+ };
57
+ return {
58
+ refs: {},
59
+ state: {
60
+ ownerState: g,
61
+ resolvedMinLevel: r,
62
+ visibleLevels: h,
63
+ variant: u,
64
+ labelPosition: v
65
+ },
66
+ actions: { handleChange: (e) => {
67
+ d(e.target.value);
68
+ } }
69
+ };
70
+ };
71
+ export {
72
+ R as useSecurityLevelLogic
73
+ };
@@ -0,0 +1,47 @@
1
+ import { styled as e, Box as o, Typography as n, FormControl as c, Select as s, MenuItem as i, FormHelperText as a } from "@mui/material";
2
+ const l = (t) => t !== "ownerState", u = e(o, {
3
+ name: "HCSecurityLevel",
4
+ slot: "root",
5
+ shouldForwardProp: l
6
+ })({}), y = e(o, {
7
+ name: "HCSecurityLevel",
8
+ slot: "leftLayout"
9
+ })({
10
+ display: "flex",
11
+ alignItems: "center"
12
+ }), L = e(n, {
13
+ name: "HCSecurityLevel",
14
+ slot: "leftLabel"
15
+ })({
16
+ width: "32%"
17
+ }), S = e(o, {
18
+ name: "HCSecurityLevel",
19
+ slot: "leftContent"
20
+ })({
21
+ width: "68%"
22
+ }), C = e(c, {
23
+ name: "HCSecurityLevel",
24
+ slot: "formControl",
25
+ shouldForwardProp: l
26
+ })(({ theme: t, ownerState: r }) => ({
27
+ ...r.variant === "outlined" && { marginTop: t.spacing(1) }
28
+ })), p = e(s, {
29
+ name: "HCSecurityLevel",
30
+ slot: "select"
31
+ })({}), v = e(i, {
32
+ name: "HCSecurityLevel",
33
+ slot: "menuItem"
34
+ })({}), H = e(a, {
35
+ name: "HCSecurityLevel",
36
+ slot: "helperText"
37
+ })({});
38
+ export {
39
+ S as LeftContent,
40
+ L as LeftLabel,
41
+ y as LeftLayout,
42
+ C as SecurityFormControl,
43
+ H as SecurityHelperText,
44
+ u as SecurityLevelRoot,
45
+ v as SecurityMenuItem,
46
+ p as SecuritySelect
47
+ };
@@ -3,7 +3,7 @@ import "@mui/material";
3
3
  import "@mui/x-date-pickers";
4
4
  import "./logic.js";
5
5
  import "./styled.js";
6
- import { D as a } from "../../index-syTc6m_V.js";
6
+ import { D as a } from "../../index-C8C3YXle.js";
7
7
  export {
8
8
  a as DatePickerWithCustomRange
9
9
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as o, jsxs as i, Fragment as p } from "react/jsx-runtime";
2
- import { EditOutlined as D, DeleteOutline as A, AddLocationOutlined as I, DrawOutlined as k, LayersOutlined as u } from "@mui/icons-material";
2
+ import { EditOutlined as D, DeleteOutline as I, AddLocationOutlined as A, DrawOutlined as k, LayersOutlined as u } from "@mui/icons-material";
3
3
  import { Container as O, Actions as y, Button as l } from "./styled.js";
4
4
  import S from "./logic.js";
5
5
  import b from "./coordinate/index.js";
@@ -7,10 +7,11 @@ import E from "./edit/index.js";
7
7
  import g from "./geometry/index.js";
8
8
  import L from "./kml/index.js";
9
9
  import W from "./wkt/index.js";
10
- import { IconButton as h, OutlinedInput as K, FilledInput as F, Dialog as z, DialogTitle as B, DialogContent as G } from "@mui/material";
11
- import { I as T } from "../../InputAdornment-DLxWUE6H.js";
12
- import { a as w, F as M, I as j, b as x } from "../../FormControl-BLbrq4C7.js";
13
- const _ = ({
10
+ import { IconButton as h, OutlinedInput as F, FilledInput as K, Dialog as z, DialogTitle as B, DialogContent as G } from "@mui/material";
11
+ import { I as T } from "../../InputAdornment-C7PEvvYr.js";
12
+ import { F as w, I as M } from "../../InputLabel-rEwwnD4_.js";
13
+ import { F as j, I as x } from "../../FormControl-BCurCxRj.js";
14
+ const $ = ({
14
15
  label: r,
15
16
  mapboxAccessToken: c,
16
17
  value: e = "",
@@ -26,7 +27,7 @@ const _ = ({
26
27
  onChange: C
27
28
  }), a = /* @__PURE__ */ o(T, { position: "end", children: e !== "" && /* @__PURE__ */ i(p, { children: [
28
29
  /* @__PURE__ */ o(h, { size: "small", onClick: n.onEdit, children: /* @__PURE__ */ o(D, { fontSize: "small" }) }),
29
- /* @__PURE__ */ o(h, { size: "small", onClick: n.onDelete, children: /* @__PURE__ */ o(A, { fontSize: "small" }) })
30
+ /* @__PURE__ */ o(h, { size: "small", onClick: n.onDelete, children: /* @__PURE__ */ o(I, { fontSize: "small" }) })
30
31
  ] }) });
31
32
  return /* @__PURE__ */ i(p, { children: [
32
33
  m === "top" && r !== void 0 && /* @__PURE__ */ o(w, { sx: { display: "block", mb: 0.5 }, children: r }),
@@ -36,7 +37,7 @@ const _ = ({
36
37
  l,
37
38
  {
38
39
  color: "inherit",
39
- startIcon: /* @__PURE__ */ o(I, {}),
40
+ startIcon: /* @__PURE__ */ o(A, {}),
40
41
  onClick: n.onAddCoordinate,
41
42
  children: "Add Coordinate"
42
43
  }
@@ -70,17 +71,17 @@ const _ = ({
70
71
  )
71
72
  ] }),
72
73
  /* @__PURE__ */ i(
73
- M,
74
+ j,
74
75
  {
75
76
  fullWidth: !0,
76
77
  variant: d,
77
78
  contentEditable: !1,
78
79
  onClick: n.onClick,
79
80
  children: [
80
- m === "default" && /* @__PURE__ */ o(j, { shrink: !!e, children: r }),
81
+ m === "default" && /* @__PURE__ */ o(M, { shrink: !!e, children: r }),
81
82
  d === "standard" && /* @__PURE__ */ o(x, { value: e, readOnly: !0, endAdornment: a }),
82
83
  d === "outlined" && /* @__PURE__ */ o(
83
- K,
84
+ F,
84
85
  {
85
86
  label: m === "default" ? r : void 0,
86
87
  value: e,
@@ -88,7 +89,7 @@ const _ = ({
88
89
  endAdornment: a
89
90
  }
90
91
  ),
91
- d === "filled" && /* @__PURE__ */ o(F, { value: e, readOnly: !0, endAdornment: a })
92
+ d === "filled" && /* @__PURE__ */ o(K, { value: e, readOnly: !0, endAdornment: a })
92
93
  ]
93
94
  }
94
95
  )
@@ -141,5 +142,5 @@ const _ = ({
141
142
  ] });
142
143
  };
143
144
  export {
144
- _ as GeometryPicker
145
+ $ as GeometryPicker
145
146
  };
@@ -6,7 +6,7 @@ import "lodash";
6
6
  import "react";
7
7
  import "../../../../hooks/useToggle.js";
8
8
  import "../../../conditional-wrapper/index.js";
9
- import { C as s } from "../../../../index-CcdvNlgr.js";
9
+ import { C as s } from "../../../../index-DPKUmQnz.js";
10
10
  import "./styled.js";
11
11
  export {
12
12
  s as default
@@ -3,20 +3,18 @@ import "@mui/icons-material";
3
3
  import "@mui/material";
4
4
  import "dayjs";
5
5
  import "lodash";
6
- import { V as k } from "../../../../index-CcdvNlgr.js";
6
+ import { V as h } from "../../../../index-DPKUmQnz.js";
7
7
  import "../../../date-time-picker/index.js";
8
8
  import "../../../geometry-picker/index.js";
9
9
  import "../../../phone-input/index.js";
10
10
  import "../../../conditional-wrapper/index.js";
11
11
  import "../TopLabelWrapper.js";
12
12
  import "../composite-matrix/index.js";
13
- import "../../../../Box-p6OtTUEo.js";
14
- import "../../../../TextField-1yCesIbH.js";
15
- import "../../../../FormControlLabel-C8SPv14J.js";
16
- import "../../../../Checkbox-CWRMFTBp.js";
17
- import "../../../../FormControl-BLbrq4C7.js";
18
- import "../../../../Select-BgYwkZgI.js";
19
- import "../../../../MenuItem-xZx_w7zA.js";
13
+ import "../../../../MenuItem-DrE50M_p.js";
14
+ import "../../../../TextField-DSDIEEKu.js";
15
+ import "../../../../FormControlLabel-BkRfrhNy.js";
16
+ import "../../../../FormControl-BCurCxRj.js";
17
+ import "../../../../InputLabel-rEwwnD4_.js";
20
18
  export {
21
- k as default
19
+ h as default
22
20
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx as u, Fragment as I, jsxs as _ } from "react/jsx-runtime";
2
2
  import b from "react";
3
- import { V as g } from "../../../../index-CcdvNlgr.js";
3
+ import { V as g } from "../../../../index-DPKUmQnz.js";
4
4
  import p from "lodash";
5
5
  import { Box as i } from "@mui/material";
6
6
  function C({
@@ -8,7 +8,7 @@ import { ConditionalWrapper as m } from "../conditional-wrapper/index.js";
8
8
  import { Container as Be } from "../container/index.js";
9
9
  import { DisseminationList as Ae } from "../data-security-selectors/dissemination-list/index.js";
10
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";
11
+ import { i as Ne, d as _e } from "../../utils-Cxu-fHjQ.js";
12
12
  import { TreeSelect as We } from "../tree-select/index.js";
13
13
  import qe from "./components/policy-list/index.js";
14
14
  import L from "./components/TopLabelWrapper.js";
@@ -1,58 +1,53 @@
1
- import { jsx as r, Fragment as c, jsxs as m } from "react/jsx-runtime";
2
- import { Accordion as d, AccordionSummary as u, AccordionDetails as g } from "./styled.js";
3
- import { Typography as l, Chip as f } from "@mui/material";
4
- import { ChevronRight as y } from "@mui/icons-material";
5
- import { getPageIcon as I, getTemplateHierarchy as x } from "../../utils/ontology.js";
6
- import { InstanceTable as b } from "../instance-table/index.js";
7
- const W = ({
8
- data: n,
9
- templates: i,
10
- ...s
11
- }) => {
12
- const h = (t) => t ? x(i, t).map((e) => e.name).join(" / ") : " ";
13
- return !n || !n.results ? /* @__PURE__ */ r(c, {}) : n.results.map((t, o) => {
14
- const e = i.get(t.templateId);
15
- if (!e) return /* @__PURE__ */ r(c, {});
16
- const a = I(i, e.id);
17
- return /* @__PURE__ */ m(
18
- d,
1
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
+ import { ChevronRight as h } from "@mui/icons-material";
3
+ import { getPageIcon as I } from "../../utils/ontology.js";
4
+ import { InstanceTable as f } from "../instance-table/index.js";
5
+ import { useInstanceHierarchyTableLogic as x } from "./logic.js";
6
+ import { HierarchyRoot as y, Accordion as b, AccordionSummary as g, TemplateIcon as H, TemplateName as T, CountChip as C, HierarchyLabel as v, AccordionDetails as A } from "./styled.js";
7
+ const z = (r) => {
8
+ const { state: l, actions: s } = x(r), { ownerState: m } = l, { data: a, templates: o, ...d } = r;
9
+ return !a || !a.results ? null : /* @__PURE__ */ e(y, { ownerState: m, sx: r.sx, children: a.results.map((n, p) => {
10
+ const t = o.get(n.templateId);
11
+ if (!t) return null;
12
+ const c = I(o, t.id);
13
+ return /* @__PURE__ */ i(
14
+ b,
19
15
  {
20
16
  defaultExpanded: !0,
21
17
  disableGutters: !0,
22
18
  elevation: 0,
23
19
  square: !0,
24
20
  children: [
25
- /* @__PURE__ */ m(u, { expandIcon: /* @__PURE__ */ r(y, {}), children: [
26
- /* @__PURE__ */ r("img", { src: a, height: 22, style: { maxWidth: 22 } }),
27
- /* @__PURE__ */ r(l, { fontWeight: "500", ml: 2, children: e.name }),
28
- /* @__PURE__ */ r(
29
- f,
21
+ /* @__PURE__ */ i(g, { expandIcon: /* @__PURE__ */ e(h, {}), children: [
22
+ /* @__PURE__ */ e(H, { src: c }),
23
+ /* @__PURE__ */ e(T, { children: t.name }),
24
+ /* @__PURE__ */ e(
25
+ C,
30
26
  {
31
27
  color: "primary",
32
- label: t.totalInstanceCount,
33
- size: "small",
34
- sx: { height: 20, ml: 1 }
28
+ label: n.totalInstanceCount,
29
+ size: "small"
35
30
  }
36
31
  ),
37
- /* @__PURE__ */ r(l, { variant: "caption", ml: 2, children: h(e) })
32
+ /* @__PURE__ */ e(v, { variant: "caption", children: s.getHierarchy(t) })
38
33
  ] }),
39
- /* @__PURE__ */ r(g, { children: /* @__PURE__ */ r(
40
- b,
34
+ /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e(
35
+ f,
41
36
  {
42
- data: t.instances.map((p) => ({
43
- ...p,
44
- templateId: e.id
37
+ data: n.instances.map((u) => ({
38
+ ...u,
39
+ templateId: t.id
45
40
  })),
46
- template: { ...e, icon: a },
47
- ...s
41
+ template: { ...t, icon: c },
42
+ ...d
48
43
  }
49
44
  ) })
50
45
  ]
51
46
  },
52
- o
47
+ p
53
48
  );
54
- });
49
+ }) });
55
50
  };
56
51
  export {
57
- W as InstanceHierarchyTable
52
+ z as InstanceHierarchyTable
58
53
  };
@@ -0,0 +1,16 @@
1
+ import { useThemeProps as o } from "@mui/material";
2
+ import { getTemplateHierarchy as c } from "../../utils/ontology.js";
3
+ const m = (t) => {
4
+ const e = o({
5
+ props: t,
6
+ name: "HCInstanceHierarchyTable"
7
+ }), a = { ...e };
8
+ return {
9
+ refs: {},
10
+ state: { ownerState: a },
11
+ actions: { getHierarchy: (r) => r ? c(e.templates, r).map((n) => n.name).join(" / ") : " " }
12
+ };
13
+ };
14
+ export {
15
+ m as useInstanceHierarchyTableLogic
16
+ };
@@ -1,29 +1,70 @@
1
- import { styled as r } from "@mui/material";
2
- import { A as e, a as i, b as n } from "../../AccordionSummary-DgAwVTk8.js";
3
- const c = r(e)(({ theme: o }) => ({
4
- borderBottom: `1px solid ${o.palette.divider}`,
1
+ import { styled as a, Box as n, Typography as o, Chip as r } from "@mui/material";
2
+ import { A as t, a as c, b as i } from "../../AccordionSummary-CMg08YSA.js";
3
+ const s = (e) => e !== "ownerState", l = a(n, {
4
+ name: "HCInstanceHierarchyTable",
5
+ slot: "root",
6
+ shouldForwardProp: s
7
+ })({}), p = a(t, {
8
+ name: "HCInstanceHierarchyTable",
9
+ slot: "accordion"
10
+ })(({ theme: e }) => ({
11
+ borderBottom: `1px solid ${e.palette.divider}`,
5
12
  "&:before": {
6
13
  display: "none"
7
14
  }
8
- })), t = r(i)(({ theme: o }) => ({
15
+ })), g = a(c, {
16
+ name: "HCInstanceHierarchyTable",
17
+ slot: "summary"
18
+ })(({ theme: e }) => ({
9
19
  flexDirection: "row-reverse",
10
20
  paddingLeft: 0,
11
21
  "& .MuiAccordionSummary-expandIconWrapper.Mui-expanded": {
12
22
  transform: "rotate(90deg)"
13
23
  },
14
24
  "& .MuiAccordionSummary-content": {
15
- marginLeft: o.spacing(1),
25
+ marginLeft: e.spacing(1),
16
26
  alignItems: "center"
17
27
  }
18
- })), p = r(n)(({ theme: o }) => ({
19
- padding: o.spacing(2),
28
+ })), h = a(i, {
29
+ name: "HCInstanceHierarchyTable",
30
+ slot: "details"
31
+ })(({ theme: e }) => ({
32
+ padding: e.spacing(2),
20
33
  paddingTop: 0,
21
34
  paddingBottom: 0,
22
35
  borderTop: "1px solid rgba(0, 0, 0, .125)",
23
- background: o.palette.grey[100]
36
+ background: e.palette.grey[100]
37
+ })), y = a("img", {
38
+ name: "HCInstanceHierarchyTable",
39
+ slot: "templateIcon"
40
+ })({
41
+ height: 22,
42
+ maxWidth: 22
43
+ }), H = a(o, {
44
+ name: "HCInstanceHierarchyTable",
45
+ slot: "templateName"
46
+ })(({ theme: e }) => ({
47
+ fontWeight: 500,
48
+ marginLeft: e.spacing(2)
49
+ })), b = a(r, {
50
+ name: "HCInstanceHierarchyTable",
51
+ slot: "countChip"
52
+ })(({ theme: e }) => ({
53
+ height: 20,
54
+ marginLeft: e.spacing(1)
55
+ })), T = a(o, {
56
+ name: "HCInstanceHierarchyTable",
57
+ slot: "hierarchyLabel"
58
+ })(({ theme: e }) => ({
59
+ marginLeft: e.spacing(2)
24
60
  }));
25
61
  export {
26
- c as Accordion,
27
- p as AccordionDetails,
28
- t as AccordionSummary
62
+ p as Accordion,
63
+ h as AccordionDetails,
64
+ g as AccordionSummary,
65
+ b as CountChip,
66
+ T as HierarchyLabel,
67
+ l as HierarchyRoot,
68
+ y as TemplateIcon,
69
+ H as TemplateName
29
70
  };
@@ -1,160 +1,55 @@
1
- import { jsx as o, Fragment as D, jsxs as Y } from "react/jsx-runtime";
2
- import { useMemo as j } from "react";
3
- import { DataGrid as G, GridActionsCellItem as A } from "@mui/x-data-grid";
4
- import { ButtonBase as B, Box as S } from "@mui/material";
5
- import { DataGridActions as $ } from "./styled.js";
6
- import i from "dayjs";
7
- import E from "lodash";
8
- const L = ({
9
- template: n,
10
- data: w,
11
- selectedIds: M = [],
12
- sortColumnsBy: N = "type",
13
- actions: h,
14
- actionsWidth: y = 50,
15
- enableCheckboxSelection: R = !1,
16
- fieldOptions: e,
17
- onSelect: s,
18
- onTitleClick: C
19
- }) => {
20
- const k = j(() => {
21
- var l, c, d, g, v, b, x, I;
22
- return [
23
- ...(l = e == null ? void 0 : e.templateIcon) != null && l.hidden ? [] : [
24
- {
25
- field: "template",
26
- headerName: "",
27
- sortable: !1,
28
- filterable: !1,
29
- align: "center",
30
- width: 30,
31
- renderCell: (c = e == null ? void 0 : e.templateIcon) != null && c.renderCell ? (d = e == null ? void 0 : e.templateIcon) == null ? void 0 : d.renderCell : () => n ? /* @__PURE__ */ o(
32
- "img",
33
- {
34
- src: n.icon,
35
- height: 20,
36
- style: { display: "inline", maxWidth: 20 }
37
- }
38
- ) : /* @__PURE__ */ o(D, {})
39
- }
40
- ],
41
- ...(g = e == null ? void 0 : e.title) != null && g.hidden ? [] : [
42
- {
43
- field: "title",
44
- headerName: "Title",
45
- width: 400,
46
- sortable: !1,
47
- filterable: !1,
48
- valueGetter: (r) => r.row.title,
49
- renderCell: (v = e == null ? void 0 : e.title) != null && v.renderCell ? (b = e == null ? void 0 : e.title) == null ? void 0 : b.renderCell : (r) => {
50
- const { row: a, value: u } = r;
51
- return C ? /* @__PURE__ */ o(
52
- B,
53
- {
54
- onClick: () => C(a),
55
- sx: { "&:hover": { textDecoration: "underline" } },
56
- disableRipple: !0,
57
- children: u
58
- }
59
- ) : u;
60
- }
61
- }
62
- ],
63
- ...(x = e == null ? void 0 : e.description) != null && x.hidden ? [] : [
64
- {
65
- field: "description",
66
- headerName: "Description",
67
- width: 400,
68
- sortable: !1,
69
- filterable: !1,
70
- valueGetter: (r) => r.row.description,
71
- renderCell: (I = e == null ? void 0 : e.description) == null ? void 0 : I.renderCell
72
- }
73
- ],
74
- ...n ? [
75
- ...n.properties.filter(
76
- (r) => (!e || !e[r.propertyId] || !e[r.propertyId].hidden) && r.visible && r.type !== "geometry" && r.type !== "coordinate"
77
- ).sort(
78
- (r, a) => N === "type" ? r.type < a.type ? -1 : r.type > a.type ? 1 : 0 : r.name < a.name ? -1 : 1
79
- ).map((r) => {
80
- var u;
81
- const a = `variables.${r.type}.${r.propertyId}`;
82
- return {
83
- field: a,
84
- headerName: r.name,
85
- sortable: !1,
86
- filterable: !1,
87
- width: 150,
88
- valueFormatter: (m) => m.value && r.type === "date" ? i(m.value).format("DD/MM/YYYY HH:mm") : m.value,
89
- valueGetter: (m) => E.get(m.row, a),
90
- renderCell: e && ((u = e[r.propertyId]) == null ? void 0 : u.renderCell)
91
- };
92
- })
93
- ] : []
94
- ];
95
- }, [n]), F = (t) => {
96
- s && s(t);
97
- }, H = (t) => h ? h.map((l) => {
98
- const { showInMenu: c, ...d } = l;
99
- return /* @__PURE__ */ o(
100
- A,
101
- {
102
- ...d,
103
- ...c ? { showInMenu: c } : void 0,
104
- onClick: () => {
105
- l.onClick && l.onClick(t);
106
- }
107
- }
108
- );
109
- }) : [];
110
- return /* @__PURE__ */ Y(S, { position: "relative", children: [
111
- /* @__PURE__ */ o(
112
- G,
1
+ import { jsxs as h, jsx as n } from "react/jsx-runtime";
2
+ import { useInstanceTableLogic as u } from "./logic.js";
3
+ import { InstanceTableRoot as m, InstanceDataGrid as w, ActionsContainer as g, ActionsDataGrid as x } from "./styled.js";
4
+ const I = () => null, A = (e) => {
5
+ const { state: s, actions: i } = u(e), {
6
+ ownerState: t,
7
+ columns: a,
8
+ selectedIds: c,
9
+ enableCheckboxSelection: r,
10
+ hasActions: d,
11
+ resolvedActionsWidth: l
12
+ } = s;
13
+ return /* @__PURE__ */ h(m, { ownerState: t, sx: e.sx, children: [
14
+ /* @__PURE__ */ n(
15
+ w,
113
16
  {
114
- columns: k,
115
- rows: w,
17
+ ownerState: t,
18
+ columns: a,
19
+ rows: e.data,
116
20
  autoHeight: !0,
117
21
  density: "compact",
118
- sx: {
119
- border: "none",
120
- "& .MuiDataGrid-main": {
121
- marginRight: h ? `${y}px` : 0
122
- }
123
- },
124
- getRowId: (t) => t.id,
22
+ getRowId: (o) => o.id,
125
23
  hideFooterPagination: !0,
126
24
  hideFooter: !0,
127
- checkboxSelection: R,
128
- rowSelectionModel: M,
129
- onRowSelectionModelChange: F,
25
+ checkboxSelection: r,
26
+ rowSelectionModel: c,
27
+ onRowSelectionModelChange: i.onRowSelectionModelChange,
130
28
  keepNonExistentRowsSelected: !0
131
29
  }
132
30
  ),
133
- h !== void 0 && /* @__PURE__ */ o($, { width: y, children: /* @__PURE__ */ o(
134
- G,
31
+ d && /* @__PURE__ */ n(g, { ownerState: t, children: /* @__PURE__ */ n(
32
+ x,
135
33
  {
136
34
  columns: [
137
35
  {
138
36
  field: "actions",
139
37
  type: "actions",
140
- width: y,
38
+ width: l,
141
39
  headerClassName: "pinned",
142
- getActions: H
40
+ getActions: i.getActions
143
41
  }
144
42
  ],
145
- rows: w,
43
+ rows: e.data,
146
44
  autoHeight: !0,
147
45
  density: "compact",
148
46
  hideFooter: !0,
149
- sx: { border: "none" },
150
- slots: {
151
- noRowsOverlay: () => /* @__PURE__ */ o(D, {})
152
- },
153
- getRowId: (t) => t.id
47
+ slots: { noRowsOverlay: I },
48
+ getRowId: (o) => o.id
154
49
  }
155
50
  ) })
156
51
  ] });
157
52
  };
158
53
  export {
159
- L as InstanceTable
54
+ A as InstanceTable
160
55
  };