@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
@@ -1,7 +1,16 @@
1
- import { jsx as n, jsxs as i, Fragment as c } from "react/jsx-runtime";
2
- import { Add as r, Remove as d } from "@mui/icons-material";
3
- import { styled as a, Accordion as e, AccordionSummary as p, alpha as s, AccordionDetails as t } from "@mui/material";
4
- const g = a((o) => /* @__PURE__ */ n(e, { disableGutters: !0, elevation: 0, square: !0, ...o }))(({ theme: o }) => ({
1
+ import { styled as t, Box as e, Accordion as a, AccordionSummary as p, alpha as i, Typography as r, AccordionDetails as l, FormLabel as c, FormControlLabel as s, Checkbox as m, Button as d } from "@mui/material";
2
+ import { Add as y, Remove as g } from "@mui/icons-material";
3
+ const u = (o) => o !== "ownerState", T = t(e, {
4
+ name: "HCTemplatePropertyFilters",
5
+ slot: "root",
6
+ shouldForwardProp: u
7
+ })({
8
+ display: "flex",
9
+ flexDirection: "column"
10
+ }), f = t(a, {
11
+ name: "HCTemplatePropertyFilters",
12
+ slot: "accordion"
13
+ })(({ theme: o }) => ({
5
14
  borderTop: `1px solid ${o.palette.divider}`,
6
15
  "&:last-of-type": {
7
16
  borderBottom: `1px solid ${o.palette.divider}`
@@ -9,21 +18,15 @@ const g = a((o) => /* @__PURE__ */ n(e, { disableGutters: !0, elevation: 0, squa
9
18
  "&::before": {
10
19
  display: "none"
11
20
  }
12
- })), x = a((o) => /* @__PURE__ */ n(
13
- p,
14
- {
15
- expandIcon: /* @__PURE__ */ i(c, { children: [
16
- /* @__PURE__ */ n(r, { className: "expandIcon", sx: { fontSize: 16 } }),
17
- /* @__PURE__ */ n(d, { className: "collapseIcon", sx: { fontSize: 16 } })
18
- ] }),
19
- ...o
20
- }
21
- ))(({ theme: o }) => ({
21
+ })), x = t(p, {
22
+ name: "HCTemplatePropertyFilters",
23
+ slot: "accordionSummary"
24
+ })(({ theme: o }) => ({
22
25
  minHeight: 30,
23
26
  paddingLeft: o.spacing(1),
24
27
  paddingRight: o.spacing(1),
25
28
  "&.Mui-expanded": {
26
- backgroundColor: s(o.palette.primary.main, 0.1),
29
+ backgroundColor: i(o.palette.primary.main, 0.1),
27
30
  "& .MuiAccordionSummary-content": {
28
31
  color: o.palette.primary.main
29
32
  }
@@ -49,16 +52,114 @@ const g = a((o) => /* @__PURE__ */ n(e, { disableGutters: !0, elevation: 0, squa
49
52
  display: "block"
50
53
  }
51
54
  }
52
- })), y = a(t)(({ theme: o }) => ({
55
+ })), C = t(r, {
56
+ name: "HCTemplatePropertyFilters",
57
+ slot: "accordionTitle"
58
+ })({
59
+ fontSize: 12
60
+ }), F = t(l, {
61
+ name: "HCTemplatePropertyFilters",
62
+ slot: "accordionDetails"
63
+ })(({ theme: o }) => ({
53
64
  display: "flex",
54
65
  flexDirection: "column",
55
66
  paddingLeft: o.spacing(1),
56
67
  paddingRight: o.spacing(1),
57
68
  paddingTop: o.spacing(1.5),
58
69
  paddingBottom: o.spacing(1.5)
59
- }));
70
+ })), I = t(e, {
71
+ name: "HCTemplatePropertyFilters",
72
+ slot: "propertyContainer"
73
+ })(({ theme: o }) => ({
74
+ marginBottom: o.spacing(1)
75
+ })), b = t(r, {
76
+ name: "HCTemplatePropertyFilters",
77
+ slot: "propertyLabel"
78
+ })(({ theme: o }) => ({
79
+ marginBottom: o.spacing(0.5),
80
+ display: "block"
81
+ })), A = t(e, {
82
+ name: "HCTemplatePropertyFilters",
83
+ slot: "propertyRangeRow"
84
+ })(({ theme: o }) => ({
85
+ display: "flex",
86
+ alignItems: "center",
87
+ marginBottom: o.spacing(2)
88
+ })), H = t(r, {
89
+ name: "HCTemplatePropertyFilters",
90
+ slot: "propertyRangeSeparator"
91
+ })(({ theme: o }) => ({
92
+ paddingLeft: o.spacing(1),
93
+ paddingRight: o.spacing(1)
94
+ })), R = t(c, {
95
+ name: "HCTemplatePropertyFilters",
96
+ slot: "propertyEnumLabel"
97
+ })(({ theme: o }) => ({
98
+ marginBottom: o.spacing(1),
99
+ fontSize: 12
100
+ })), B = t(s, {
101
+ name: "HCTemplatePropertyFilters",
102
+ slot: "propertyEnumItem"
103
+ })(({ theme: o }) => ({
104
+ margin: 0,
105
+ marginBottom: o.spacing(1)
106
+ })), L = t(m, {
107
+ name: "HCTemplatePropertyFilters",
108
+ slot: "propertyEnumCheckbox"
109
+ })(({ theme: o }) => ({
110
+ padding: 0,
111
+ marginRight: o.spacing(1),
112
+ "& .MuiSvgIcon-root": {
113
+ fontSize: 16
114
+ }
115
+ })), M = t(d, {
116
+ name: "HCTemplatePropertyFilters",
117
+ slot: "propertyShowMoreButton"
118
+ })({
119
+ padding: 0,
120
+ textTransform: "none",
121
+ fontSize: 12
122
+ }), E = t(y, {
123
+ name: "HCTemplatePropertyFilters",
124
+ slot: "expandIcon"
125
+ })({
126
+ fontSize: 16
127
+ }), z = t(g, {
128
+ name: "HCTemplatePropertyFilters",
129
+ slot: "collapseIcon"
130
+ })({
131
+ fontSize: 16
132
+ }), n = { fontSize: 12 }, _ = { fontSize: 14 }, k = {
133
+ textField: {
134
+ fullWidth: !0,
135
+ inputProps: { sx: n },
136
+ InputLabelProps: { sx: n }
137
+ },
138
+ inputAdornment: {
139
+ sx: {
140
+ "& .MuiSvgIcon-root": {
141
+ fontSize: 16
142
+ }
143
+ }
144
+ }
145
+ };
60
146
  export {
61
- g as Accordion,
62
- y as AccordionDetails,
63
- x as AccordionSummary
147
+ f as Accordion,
148
+ F as AccordionDetails,
149
+ x as AccordionSummary,
150
+ C as AccordionTitle,
151
+ z as CollapseIcon,
152
+ k as DATE_PICKER_SLOT_PROPS,
153
+ E as ExpandIcon,
154
+ n as INPUT_FONT_SX,
155
+ I as PropertyContainer,
156
+ L as PropertyEnumCheckbox,
157
+ B as PropertyEnumItem,
158
+ R as PropertyEnumLabel,
159
+ b as PropertyLabel,
160
+ A as PropertyRangeRow,
161
+ H as PropertyRangeSeparator,
162
+ M as PropertyShowMoreButton,
163
+ _ as SHOW_MORE_ICON_SX,
164
+ T as TemplatePropertyFiltersRoot
64
165
  };
@@ -1,78 +1,63 @@
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 "../../FormControl-BLbrq4C7.js";
7
- import { S as B } from "../../Select-BgYwkZgI.js";
8
- import { M as L } from "../../MenuItem-xZx_w7zA.js";
9
- import { D as w, a as y, b as N } from "../../DialogContent-B3nbEbuv.js";
10
- import { B as R } from "../../Button-CvE2gnly.js";
11
- const Z = ({
12
- data: g,
13
- label: a,
14
- selected: r,
15
- disabled: S,
16
- idKey: d = "id",
17
- variant: x = "outlined",
18
- labelPosition: c = "top",
19
- onChange: D
20
- }) => {
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();
27
- }, C = () => {
28
- v(!1);
29
- }, O = (t, e, l) => {
30
- f(l ? (s) => [
31
- ...s.filter((o) => o !== e),
32
- e
33
- ] : (s) => s.filter((o) => o !== e));
34
- }, W = () => {
35
- const t = [];
36
- p.length > 0 && p.forEach((e) => {
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);
40
- };
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,
1
+ import { jsxs as d, jsx as l } from "react/jsx-runtime";
2
+ import c from "lodash";
3
+ import { TreeViewFilter as T } from "../treeview-filter/index.js";
4
+ import { useTreeSelectLogic as f } from "./logic.js";
5
+ import { TreeSelectRoot as g, TreeSelectLabel as S, TreeSelectFormControl as x, TreeSelectInput as C, TreeSelectMenuItem as v, TreeSelectDialog as I, TreeSelectDialogContent as W, TreeSelectDialogActions as D, TreeSelectConfirmButton as L } from "./styled.js";
6
+ import { I as O } from "../../InputLabel-rEwwnD4_.js";
7
+ const K = (e) => {
8
+ const { state: h, actions: t } = f(e), { ownerState: s, open: u, expanded: m, selectedItems: i, idKey: o, variant: r, labelPosition: a } = h;
9
+ return /* @__PURE__ */ d(g, { ownerState: s, sx: e.sx, children: [
10
+ a === "top" && e.label !== void 0 && /* @__PURE__ */ l(S, { children: e.label }),
11
+ /* @__PURE__ */ d(x, { variant: r, fullWidth: !0, children: [
12
+ a === "default" && e.label !== void 0 && /* @__PURE__ */ l(O, { id: "select-label", children: e.label }),
13
+ /* @__PURE__ */ l(
14
+ C,
47
15
  {
48
- label: c === "default" ? a : void 0,
49
- variant: x,
16
+ label: a === "default" ? e.label : void 0,
17
+ variant: r,
50
18
  id: "select",
51
19
  labelId: "select-label",
52
- value: r,
20
+ value: e.selected,
53
21
  open: !1,
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))
22
+ onOpen: t.handleOpen,
23
+ children: i.length > 0 && i.map((n, b) => /* @__PURE__ */ l(v, { value: c.get(n, o) ?? "", children: n == null ? void 0 : n.name }, b))
56
24
  }
57
25
  )
58
26
  ] }),
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,
62
- {
63
- data: g,
64
- selected: i.isArray(r) ? r : void 0,
65
- disabled: S,
66
- expanded: F,
67
- idKey: d,
68
- onExpansionToggle: O,
69
- onChange: T
70
- }
71
- ) }),
72
- /* @__PURE__ */ n(N, { children: /* @__PURE__ */ n(R, { onClick: C, variant: "contained", fullWidth: !0, children: "OK" }) })
73
- ] })
27
+ /* @__PURE__ */ d(
28
+ I,
29
+ {
30
+ open: u,
31
+ onClose: t.handleClose,
32
+ fullWidth: !0,
33
+ maxWidth: "sm",
34
+ children: [
35
+ /* @__PURE__ */ l(W, { children: /* @__PURE__ */ l(
36
+ T,
37
+ {
38
+ data: e.data,
39
+ selected: c.isArray(e.selected) ? e.selected : void 0,
40
+ disabled: e.disabled,
41
+ expanded: m,
42
+ idKey: o,
43
+ onExpansionToggle: t.handleExpansionToggle,
44
+ onChange: t.handleChange
45
+ }
46
+ ) }),
47
+ /* @__PURE__ */ l(D, { children: /* @__PURE__ */ l(
48
+ L,
49
+ {
50
+ onClick: t.handleClose,
51
+ variant: "contained",
52
+ fullWidth: !0,
53
+ children: "OK"
54
+ }
55
+ ) })
56
+ ]
57
+ }
58
+ )
74
59
  ] });
75
60
  };
76
61
  export {
77
- Z as TreeSelect
62
+ K as TreeSelect
78
63
  };
@@ -0,0 +1,59 @@
1
+ import { useThemeProps as O } from "@mui/material";
2
+ import f from "lodash";
3
+ import r from "react";
4
+ import { flattenNestedTemplates as v } from "../../utils/ontology.js";
5
+ const H = (x) => {
6
+ const i = O({ props: x, name: "HCTreeSelect" }), {
7
+ data: u,
8
+ selected: l,
9
+ idKey: s = "id",
10
+ variant: h = "outlined",
11
+ labelPosition: g = "top",
12
+ onChange: S
13
+ } = i, [T, m] = r.useState(!1), [C, p] = r.useState([]), c = r.useMemo(() => v(u), [u]), d = r.useMemo(() => f.isArray(l) ? l.map(
14
+ (t) => c.find((e) => String(f.get(e, s)) === t)
15
+ ) : [], [l, c, s]), E = {
16
+ ...i,
17
+ idKey: s,
18
+ variant: h,
19
+ labelPosition: g
20
+ }, _ = (t, e) => {
21
+ S(t, e);
22
+ }, y = () => {
23
+ const t = [];
24
+ d.length > 0 && d.forEach((e) => {
25
+ const o = e == null ? void 0 : e.parentKeys, a = c.filter((n) => o == null ? void 0 : o.includes(n.templateKey)).map((n) => String(f.get(n, s)));
26
+ t.push(...a);
27
+ }), p(t);
28
+ };
29
+ return {
30
+ refs: {},
31
+ state: {
32
+ ownerState: E,
33
+ open: T,
34
+ expanded: C,
35
+ selectedItems: d,
36
+ idKey: s,
37
+ variant: h,
38
+ labelPosition: g
39
+ },
40
+ actions: {
41
+ handleChange: _,
42
+ handleOpen: () => {
43
+ m(!0), y();
44
+ },
45
+ handleClose: () => {
46
+ m(!1);
47
+ },
48
+ handleExpansionToggle: (t, e, o) => {
49
+ p(o ? (a) => [
50
+ ...a.filter((n) => n !== e),
51
+ e
52
+ ] : (a) => a.filter((n) => n !== e));
53
+ }
54
+ }
55
+ };
56
+ };
57
+ export {
58
+ H as useTreeSelectLogic
59
+ };
@@ -1,64 +1,47 @@
1
- import { styled as t, Box as e } from "@mui/material";
2
- import r from "react-dropdown-tree-select";
3
- const a = t(r)(({ theme: o }) => ({
4
- ".dropdown": {
5
- display: "block",
6
- ".dropdown-trigger": {
7
- display: "block",
8
- minHeight: 30,
9
- border: "none",
10
- padding: "4px 0px",
11
- borderBottom: `1px solid ${o.palette.text.disabled}`,
12
- transition: "all 0.3s",
13
- ".placeholder": {
14
- color: o.palette.text.disabled
15
- },
16
- "&::after": {
17
- position: "absolute",
18
- right: 0,
19
- top: 5,
20
- color: o.palette.text.primary
21
- },
22
- ".tag-list .tag-item:last-child": {
23
- display: "none"
24
- },
25
- ".tag-item": {
26
- margin: 0,
27
- fontSize: "1rem",
28
- ".tag": {
29
- padding: 0,
30
- backgroundColor: "transparent",
31
- border: "none",
32
- ".tag-remove": {
33
- display: "none"
34
- }
35
- }
36
- }
37
- },
38
- ".dropdown-content": {
39
- position: "fixed",
40
- width: "50%",
41
- backgroundColor: o.palette.background.paper,
42
- zIndex: 99999,
43
- ".toggle": {
44
- padding: "0px 5px",
45
- fontStyle: "normal",
46
- fontSize: "1rem"
47
- },
48
- ".search": {
49
- padding: 10,
50
- boxSizing: "border-box",
51
- backgroundColor: o.palette.background.paper,
52
- color: o.palette.text.primary
53
- }
54
- }
55
- }
56
- })), d = t(e)({
57
- display: "flex"
58
- }), i = {
59
- Container: a,
60
- Placeholder: d
61
- };
1
+ import { styled as e, Box as o, FormLabel as l, FormControl as n, Select as c, MenuItem as r, Dialog as a, DialogContent as s, DialogActions as i, Button as m } from "@mui/material";
2
+ const S = (t) => t !== "ownerState", C = e(o, {
3
+ name: "HCTreeSelect",
4
+ slot: "root",
5
+ shouldForwardProp: S
6
+ })({}), g = e(l, {
7
+ name: "HCTreeSelect",
8
+ slot: "label"
9
+ })(({ theme: t }) => ({
10
+ display: "block",
11
+ marginBottom: t.spacing(0.5)
12
+ })), d = e(n, {
13
+ name: "HCTreeSelect",
14
+ slot: "formControl"
15
+ })({}), p = e(c, {
16
+ name: "HCTreeSelect",
17
+ slot: "select"
18
+ })({}), H = e(r, {
19
+ name: "HCTreeSelect",
20
+ slot: "menuItem"
21
+ })({}), u = e(a, {
22
+ name: "HCTreeSelect",
23
+ slot: "dialog"
24
+ })({}), D = e(s, {
25
+ name: "HCTreeSelect",
26
+ slot: "dialogContent"
27
+ })(({ theme: t }) => ({
28
+ padding: t.spacing(1),
29
+ paddingTop: t.spacing(2)
30
+ })), B = e(i, {
31
+ name: "HCTreeSelect",
32
+ slot: "dialogActions"
33
+ })({}), b = e(m, {
34
+ name: "HCTreeSelect",
35
+ slot: "confirmButton"
36
+ })({});
62
37
  export {
63
- i as default
38
+ b as TreeSelectConfirmButton,
39
+ u as TreeSelectDialog,
40
+ B as TreeSelectDialogActions,
41
+ D as TreeSelectDialogContent,
42
+ d as TreeSelectFormControl,
43
+ p as TreeSelectInput,
44
+ g as TreeSelectLabel,
45
+ H as TreeSelectMenuItem,
46
+ C as TreeSelectRoot
64
47
  };
@@ -1,82 +1,60 @@
1
- import { jsxs as d, Fragment as p, jsx as t } from "react/jsx-runtime";
2
- import u from "react";
3
- import { SimpleTreeView as B } from "@mui/x-tree-view";
4
- import C from "./item/index.js";
5
- import a from "lodash";
6
- import { Box as F, Divider as L } from "@mui/material";
7
- import { SearchInput as _ } from "../search-input/index.js";
8
- import { flattenNestedTemplates as j } from "../../utils/ontology.js";
9
- import { ArrowDropDown as y, ArrowRight as z } from "@mui/icons-material";
10
- const H = ({
11
- data: i,
12
- idKey: s = "id",
13
- selected: m,
14
- expanded: f,
15
- disabled: c,
16
- disableSearch: h,
17
- onChange: S,
18
- onExpansionToggle: x
19
- }) => {
20
- const [r, o] = u.useState(""), b = j(i), w = u.useMemo(() => r.length > 0 ? a.uniqBy(
21
- b.filter(
22
- (e) => e.name.toLowerCase().includes(r)
23
- ),
24
- (e) => e.id
25
- ) : i, [r, i]);
26
- let n = null;
27
- const I = 500;
28
- return /* @__PURE__ */ d(p, { children: [
29
- !h && /* @__PURE__ */ d(p, { children: [
30
- /* @__PURE__ */ t(F, { px: 1, pt: 0.75, children: /* @__PURE__ */ t(
31
- _,
1
+ import { jsxs as o, Fragment as S, jsx as t } from "react/jsx-runtime";
2
+ import { ArrowDropDown as f, ArrowRight as g } from "@mui/icons-material";
3
+ import r from "lodash";
4
+ import { SearchInput as b } from "../search-input/index.js";
5
+ import { Item as w } from "./item/index.js";
6
+ import { useTreeViewFilterLogic as I } from "./logic.js";
7
+ import { TreeViewFilterRoot as T, SearchContainer as p, TreeViewDivider as C, TreeContainer as D } from "./styled.js";
8
+ const F = {
9
+ "& .MuiInputBase-input": {
10
+ padding: "8px 0px 8px 12px",
11
+ fontSize: "small"
12
+ }
13
+ }, E = {
14
+ collapseIcon: () => /* @__PURE__ */ t(f, {}),
15
+ expandIcon: () => /* @__PURE__ */ t(g, {})
16
+ }, L = (e) => {
17
+ const { state: d, actions: l } = I(e), { ownerState: c, search: s, filteredData: m, idKey: a } = d;
18
+ return /* @__PURE__ */ o(T, { ownerState: c, sx: e.sx, children: [
19
+ !e.disableSearch && /* @__PURE__ */ o(S, { children: [
20
+ /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t(
21
+ b,
32
22
  {
33
23
  fullWidth: !0,
34
24
  disableLabel: !0,
35
25
  placeholder: "Filter",
36
- sx: {
37
- "& .MuiInputBase-input": {
38
- p: "8px 0px 8px 12px",
39
- fontSize: "small"
40
- }
41
- },
26
+ sx: F,
42
27
  iconSize: "small",
43
- onChange: (e) => {
44
- n && clearTimeout(n), n = setTimeout(() => o(e.toLowerCase()), I);
45
- },
46
- onSubmit: (e) => {
47
- o(e || "");
48
- }
28
+ onChange: l.handleSearch,
29
+ onSubmit: l.handleSubmit
49
30
  }
50
31
  ) }),
51
- /* @__PURE__ */ t(L, { sx: { mt: 1.75 } })
32
+ /* @__PURE__ */ t(C, {})
52
33
  ] }),
53
34
  /* @__PURE__ */ t(
54
- B,
35
+ D,
55
36
  {
56
37
  "aria-label": "tree view filter",
57
38
  disableSelection: !0,
58
- defaultExpandedItems: f,
59
- slots: {
60
- collapseIcon: () => /* @__PURE__ */ t(y, {}),
61
- expandIcon: () => /* @__PURE__ */ t(z, {})
62
- },
63
- onItemExpansionToggle: x,
64
- children: w.map((e, g) => {
65
- const l = String(e[s]), T = a.includes(m, l), D = a.includes(c, l);
39
+ defaultExpandedItems: e.expanded,
40
+ slots: E,
41
+ onItemExpansionToggle: e.onExpansionToggle,
42
+ children: m.map((i, h) => {
43
+ const n = String(r.get(i, a)), u = r.includes(e.selected, n), x = r.includes(e.disabled, n);
66
44
  return /* @__PURE__ */ t(
67
- C,
45
+ w,
68
46
  {
69
- id: l,
70
- idKey: s,
71
- name: e.name,
72
- checked: T,
73
- disabled: D,
74
- disabledIds: c,
75
- children: r ? [] : e.children,
76
- onChange: S,
77
- defaultSelected: m
47
+ id: n,
48
+ idKey: a,
49
+ name: i.name,
50
+ checked: u,
51
+ disabled: x,
52
+ disabledIds: e.disabled,
53
+ children: s ? [] : i.children,
54
+ onChange: e.onChange,
55
+ defaultSelected: e.selected
78
56
  },
79
- g
57
+ h
80
58
  );
81
59
  })
82
60
  }
@@ -84,5 +62,5 @@ const H = ({
84
62
  ] });
85
63
  };
86
64
  export {
87
- H as TreeViewFilter
65
+ L as TreeViewFilter
88
66
  };