@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.
- package/dist/{AccordionSummary-DgAwVTk8.js → AccordionSummary-CMg08YSA.js} +20 -23
- package/dist/{Add-DJLrrVHm.js → Add-DuVVJeQU.js} +65 -67
- package/dist/{ButtonBase-2bPw77UP.js → ButtonBase-sObABYY2.js} +60 -56
- package/dist/{Delete-CW0UZv1m.js → Delete-fBLhTHbF.js} +1 -1
- package/dist/{DialogContent-B3nbEbuv.js → DialogContent-CGJ7alb8.js} +8 -10
- package/dist/{FormControl-BLbrq4C7.js → FormControl-BCurCxRj.js} +377 -719
- package/dist/FormControlLabel-BkRfrhNy.js +601 -0
- package/dist/{IconButton-CHwRQF-g.js → IconButton-_opV1iNK.js} +26 -28
- package/dist/{InputAdornment-DLxWUE6H.js → InputAdornment-C7PEvvYr.js} +16 -18
- package/dist/InputLabel-rEwwnD4_.js +354 -0
- package/dist/{MenuItem-xZx_w7zA.js → MenuItem-DrE50M_p.js} +92 -70
- package/dist/Modal-DlB6GH-f.js +1659 -0
- package/dist/Paper-q9kKjAKx.js +527 -0
- package/dist/{Select-BgYwkZgI.js → TextField-DSDIEEKu.js} +1449 -901
- package/dist/{Typography-CxbneZy_.js → Typography-B-Z5Y0Xq.js} +46 -48
- package/dist/{capitalize-ciszXJ7R.js → capitalize-quqpGCFu.js} +1 -1
- package/dist/components/access/index.js +8 -15
- package/dist/components/access/logic.js +25 -0
- package/dist/components/card/index.js +158 -498
- package/dist/components/card/logic.js +24 -0
- package/dist/components/card/styled.js +226 -51
- package/dist/components/card-alternate/index.js +111 -139
- package/dist/components/card-alternate/logic.js +17 -0
- package/dist/components/card-alternate/styled.js +113 -19
- package/dist/components/collapsible-card/index.js +1 -1
- package/dist/components/collapsible-card/styled.js +1 -1
- package/dist/components/confirm/dialog.js +3 -3
- package/dist/components/confirm/index.js +1 -1
- package/dist/components/container/index.js +28 -269
- package/dist/components/container/logic.js +12 -0
- package/dist/components/container/styled.js +29 -0
- package/dist/components/context-menu/index.js +25 -457
- package/dist/components/context-menu/logic.js +14 -0
- package/dist/components/context-menu/styled.js +40 -0
- package/dist/components/data-security-selectors/security-level/index.js +36 -91
- package/dist/components/data-security-selectors/security-level/logic.js +73 -0
- package/dist/components/data-security-selectors/security-level/styled.js +47 -0
- package/dist/components/date-picker-with-custom-range/index.js +1 -1
- package/dist/components/geometry-picker/index.js +13 -12
- package/dist/components/instance-form/components/composite-list/index.js +1 -1
- package/dist/components/instance-form/components/variable/index.js +7 -9
- package/dist/components/instance-form/components/variables/index.js +1 -1
- package/dist/components/instance-form/index.js +1 -1
- package/dist/components/instance-hierarchy-table/index.js +32 -37
- package/dist/components/instance-hierarchy-table/logic.js +16 -0
- package/dist/components/instance-hierarchy-table/styled.js +53 -12
- package/dist/components/instance-table/index.js +30 -135
- package/dist/components/instance-table/logic.js +122 -0
- package/dist/components/instance-table/styled.js +53 -11
- package/dist/components/key-protection/index.js +45 -2
- package/dist/components/key-protection/logic.js +40 -0
- package/dist/components/key-protection/styled.js +45 -0
- package/dist/components/key-protection/utils.js +1 -1
- package/dist/components/loading/index.js +15 -9
- package/dist/components/loading/logic.js +15 -0
- package/dist/components/loading/styled.js +26 -19
- package/dist/components/phone-input/index.js +18 -22
- package/dist/components/phone-input/logic.js +14 -0
- package/dist/components/phone-input/styled.js +12 -4
- package/dist/components/property-mapping/index.js +1 -1
- package/dist/components/range-selector/components/composite-list-range/index.js +42 -50
- package/dist/components/range-selector/components/date-range/index.js +87 -4221
- package/dist/components/range-selector/components/geometry-range/index.js +11 -17
- package/dist/components/range-selector/components/number-range/index.js +48 -53
- package/dist/components/range-selector/components/string-range/index.js +15 -17
- package/dist/components/range-selector/index.js +63 -57
- package/dist/components/range-selector/logic.js +12 -0
- package/dist/components/range-selector/styled.js +4222 -0
- package/dist/components/template-filters/components/filter/index.js +13 -18
- package/dist/components/template-filters/components/tab-panel/index.js +8 -16
- package/dist/components/template-filters/index.js +21 -29
- package/dist/components/template-filters/logic.js +18 -0
- package/dist/components/template-filters/styled.js +44 -1
- package/dist/components/template-form/components/property-list/index.js +8 -8
- package/dist/components/template-form/components/property-list/property-list-columns.js +3 -3
- package/dist/components/template-form/components/property-list/property-list-form.js +8 -10
- package/dist/components/template-form/components/recognition-property-list/index.js +6 -6
- package/dist/components/template-form/components/recognition-property-list/recognition-property-list-columns.js +2 -2
- package/dist/components/template-form/components/recognition-property-list/recognition-property-list-form.js +8 -9
- package/dist/components/template-form/index.js +32 -33
- package/dist/components/template-property-filters/index.js +45 -95
- package/dist/components/template-property-filters/logic.js +27 -0
- package/dist/components/template-property-filters/property.js +105 -165
- package/dist/components/template-property-filters/styled.js +121 -20
- package/dist/components/tree-select/index.js +52 -67
- package/dist/components/tree-select/logic.js +59 -0
- package/dist/components/tree-select/styled.js +45 -62
- package/dist/components/treeview-filter/index.js +43 -65
- package/dist/components/treeview-filter/item/index.js +43 -42
- package/dist/components/treeview-filter/item-label/index.js +17 -37
- package/dist/components/treeview-filter/logic.js +28 -0
- package/dist/components/treeview-filter/styled.js +86 -0
- package/dist/components/uploader/index.js +532 -567
- package/dist/components/uploader/logic.js +74 -0
- package/dist/components/uploader/styled.js +93 -46
- package/dist/{createSvgIcon-BjpIhJ30.js → createSvgIcon-BM3-TsGy.js} +25 -26
- package/dist/{createSvgIcon-DrtgaibK.js → createSvgIcon-DX-SqL8M.js} +23 -25
- package/dist/{dialog-DcwXug9J.js → dialog-cf4HUXXl.js} +26 -27
- package/dist/{index-syTc6m_V.js → index-C8C3YXle.js} +92 -94
- package/dist/{index-CcdvNlgr.js → index-DPKUmQnz.js} +11 -13
- package/dist/isMuiElement-BkJ72LB3.js +26 -0
- package/dist/main.d.ts +734 -298
- package/dist/main.js +15 -15
- package/dist/{property-list-form-zZQfpR0X.js → property-list-form-DL_dEoNn.js} +56 -61
- package/dist/{createTheme-DYxDnE9u.js → styled-Bsjp3kFh.js} +232 -176
- package/dist/{useMobilePicker-BLg3Blg8.js → useMobilePicker-B-M3dnTn.js} +2692 -2288
- package/dist/{utils-Bq0ye5vf.js → utils-Cxu-fHjQ.js} +7 -7
- package/package.json +1 -1
- package/dist/Box-p6OtTUEo.js +0 -30
- package/dist/Button-CvE2gnly.js +0 -370
- package/dist/CardContent-CSHh-ZlM.js +0 -74
- package/dist/Checkbox-CWRMFTBp.js +0 -421
- package/dist/FormControlLabel-C8SPv14J.js +0 -195
- package/dist/List-tqElle9C.js +0 -121
- package/dist/ListItem-CfjsIg4B.js +0 -430
- package/dist/Modal-DhPpOoGB.js +0 -1299
- package/dist/Paper-2B03OBmZ.js +0 -169
- package/dist/TextField-1yCesIbH.js +0 -457
- package/dist/components/key-protection/menu.js +0 -85
- package/dist/components/treeview-filter/item/styled.js +0 -39
- package/dist/debounce-46wSf_lW.js +0 -15
- package/dist/isHostComponent-kiaBvYVo.js +0 -6
- package/dist/isMuiElement-CxT3_ACP.js +0 -13
- package/dist/listItemTextClasses-C3lndiXO.js +0 -16
- package/dist/styled-eZwjUruw.js +0 -12
- package/dist/useFormControl-CatNKXAi.js +0 -10
- package/dist/useThemeProps-BzzHcQyd.js +0 -58
- package/dist/utils-BDNynJcd.js +0 -365
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Add as
|
|
3
|
-
|
|
4
|
-
|
|
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 =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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:
|
|
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
|
-
})),
|
|
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
|
-
|
|
62
|
-
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import { TreeViewFilter as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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:
|
|
49
|
-
variant:
|
|
16
|
+
label: a === "default" ? e.label : void 0,
|
|
17
|
+
variant: r,
|
|
50
18
|
id: "select",
|
|
51
19
|
labelId: "select-label",
|
|
52
|
-
value:
|
|
20
|
+
value: e.selected,
|
|
53
21
|
open: !1,
|
|
54
|
-
onOpen:
|
|
55
|
-
children:
|
|
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__ */
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
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
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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:
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
onSubmit: (e) => {
|
|
47
|
-
o(e || "");
|
|
48
|
-
}
|
|
28
|
+
onChange: l.handleSearch,
|
|
29
|
+
onSubmit: l.handleSubmit
|
|
49
30
|
}
|
|
50
31
|
) }),
|
|
51
|
-
/* @__PURE__ */ t(
|
|
32
|
+
/* @__PURE__ */ t(C, {})
|
|
52
33
|
] }),
|
|
53
34
|
/* @__PURE__ */ t(
|
|
54
|
-
|
|
35
|
+
D,
|
|
55
36
|
{
|
|
56
37
|
"aria-label": "tree view filter",
|
|
57
38
|
disableSelection: !0,
|
|
58
|
-
defaultExpandedItems:
|
|
59
|
-
slots:
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
45
|
+
w,
|
|
68
46
|
{
|
|
69
|
-
id:
|
|
70
|
-
idKey:
|
|
71
|
-
name:
|
|
72
|
-
checked:
|
|
73
|
-
disabled:
|
|
74
|
-
disabledIds:
|
|
75
|
-
children:
|
|
76
|
-
onChange:
|
|
77
|
-
defaultSelected:
|
|
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
|
-
|
|
57
|
+
h
|
|
80
58
|
);
|
|
81
59
|
})
|
|
82
60
|
}
|
|
@@ -84,5 +62,5 @@ const H = ({
|
|
|
84
62
|
] });
|
|
85
63
|
};
|
|
86
64
|
export {
|
|
87
|
-
|
|
65
|
+
L as TreeViewFilter
|
|
88
66
|
};
|