@hybridcore/ui 1.1.2 → 1.2.0
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/{ButtonBase-BYmh3G5j.js → ButtonBase-C7CHOX3y.js} +8 -7
- package/dist/{CardContent-C8PxkJz4.js → CardContent-DDFwwGfd.js} +3 -3
- package/dist/Checkbox-DP6_qp1v.js +469 -0
- package/dist/Collapse-9egEADkh.js +296 -0
- package/dist/{DialogContent-2aPOjKE7.js → DialogContent-MMUsECN2.js} +746 -789
- package/dist/{FormControl-BiAFm76F.js → FormControl-Cj5nc-Nv.js} +151 -163
- package/dist/FormControlLabel-j_atSYQA.js +827 -0
- package/dist/{IconButton-CQJ8wZE8.js → IconButton-2FRFauye.js} +4 -4
- package/dist/{Input-Bf5G3tFN.js → Input-BY_yKOrF.js} +5 -5
- package/dist/{listItemTextClasses-BvXFz-Oc.js → List-CgBXAAKA.js} +50 -62
- package/dist/ListItem-BFDUUjHt.js +428 -0
- package/dist/MenuItem-BejUFNIP.js +233 -0
- package/dist/{OutlinedInput-BEVE8VZQ.js → OutlinedInput-CnzESIDi.js} +5 -5
- package/dist/{Paper-CaiWdndQ.js → Paper-k37cShvn.js} +4 -4
- package/dist/{Select-DxpxZbJp.js → Select-BGt6e73I.js} +804 -1025
- package/dist/{Typography-XIiVCSto.js → Typography-Bjo-B13o.js} +3 -3
- package/dist/{chainPropTypes-DtBfUj5o.js → chainPropTypes-BmidnkZm.js} +2 -2
- package/dist/components/card/index.js +5 -5
- package/dist/components/card/styled.js +1 -1
- package/dist/components/collapsible-card/index.js +34 -0
- package/dist/components/collapsible-card/style.js +575 -0
- package/dist/components/confirm/dialog.js +5 -5
- package/dist/components/container/index.js +6 -6
- package/dist/components/context-menu/index.js +191 -603
- package/dist/components/data-management/instance-form/components/composite-list/index.js +1 -1
- package/dist/components/data-management/instance-form/components/variable/index.js +7 -5
- package/dist/components/data-management/instance-form/components/variables/index.js +1 -1
- package/dist/components/geometry-picker/coordinate/index.js +1 -1
- package/dist/components/geometry-picker/edit/index.js +1 -1
- package/dist/components/geometry-picker/geometry/index.js +1 -1
- package/dist/components/geometry-picker/index.js +2 -2
- package/dist/components/geometry-picker/kml/index.js +1 -1
- package/dist/components/geometry-picker/map/index.js +1 -1
- package/dist/components/geometry-picker/map/logic.js +1 -1
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/map/helpers/ol.js +2 -2
- package/dist/components/map/index.js +2 -2
- package/dist/components/map/logic.js +1 -1
- package/dist/components/map/styled.js +89 -6
- package/dist/components/search-input/index.js +119 -48
- package/dist/components/template-property-filters/index.js +78 -0
- package/dist/components/template-property-filters/property.js +7019 -0
- package/dist/components/tree-select/index.js +14 -13
- package/dist/components/treeview-filter/index.js +263 -328
- package/dist/components/treeview-filter/item/index.js +1 -1
- package/dist/components/treeview-filter/item-label/index.js +2 -2
- package/dist/createSvgIcon-DAR6Hwv8.js +77 -0
- package/dist/createSvgIcon-R_PakhKf.js +213 -0
- package/dist/{createTheme-agWfFD64.js → createTheme-oOCi1S_n.js} +5 -5
- package/dist/debounce-46wSf_lW.js +15 -0
- package/dist/{exactProp-CI8dagM-.js → exactProp-DhXxfU8X.js} +2 -2
- package/dist/index-C7W2wuUG.js +609 -0
- package/dist/index-DHnXB0CB.js +287 -0
- package/dist/{index-IvOfmM1F.js → index-JrtqxUdI.js} +6 -6
- package/dist/listItemTextClasses-CaI8l2PD.js +16 -0
- package/dist/main.d.ts +140 -0
- package/dist/main.js +1 -1
- package/dist/{ol-DXmSLlWv.js → ol-q6vTiF_t.js} +1 -1
- package/dist/resolveComponentProps-BwtY1IP3.js +54 -0
- package/dist/styled-CHMAYxVs.js +142 -0
- package/dist/{styled-Iq9jsO4F.js → styled-Wx2vv4j8.js} +1 -1
- package/dist/unsupportedProp-BuVD30Gh.js +9 -0
- package/dist/{useTheme-C0Dky5rV.js → useTheme-BI40KZ7w.js} +2 -1
- package/dist/{useTheme-CeyGVuQP.js → useTheme-CD5DEi5n.js} +2 -2
- package/dist/useThemeProps-D4or2IlT.js +62 -0
- package/dist/{useThemeProps-CzAjOL6F.js → useThemeProps-DT5EdhcP.js} +5 -4
- package/dist/{utils-DLpkeyhZ.js → utils-BEaBPoDF.js} +10 -10
- package/package.json +1 -1
- package/dist/Checkbox-DostZSwR.js +0 -673
- package/dist/index-Bw_m9ult.js +0 -1105
- package/dist/index-wW2D1aTG.js +0 -957
- package/dist/styled-C43K9x7T.js +0 -229
|
@@ -1,284 +1,236 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { c as
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { u as
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
function Bt(i, d) {
|
|
22
|
-
return process.env.NODE_ENV === "production" ? () => null : (b, g, T, O, E) => {
|
|
23
|
-
const M = T || "<<anonymous>>", N = E || g;
|
|
24
|
-
return typeof b[g] < "u" ? new Error(`The ${O} \`${N}\` of \`${M}\` is deprecated. ${d}`) : null;
|
|
25
|
-
};
|
|
1
|
+
import Ne, { jsx as C, jsxs as it, Fragment as ut } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import Se from "react";
|
|
4
|
+
import { g as dt, s as ft, i as Oe } from "../../styled-Wx2vv4j8.js";
|
|
5
|
+
import { r as Te } from "../../createSvgIcon-DAR6Hwv8.js";
|
|
6
|
+
import { T as pt, D as ht, c as mt, I as xt } from "../../index-C7W2wuUG.js";
|
|
7
|
+
import we from "lodash";
|
|
8
|
+
import { Box as gt } from "@mui/material";
|
|
9
|
+
import { SearchInput as bt } from "../search-input/index.js";
|
|
10
|
+
import { flattenNestedTemplates as St } from "../../utils/ontology.js";
|
|
11
|
+
import { P as o } from "../../createTheme-oOCi1S_n.js";
|
|
12
|
+
import { g as wt, a as yt } from "../../chainPropTypes-BmidnkZm.js";
|
|
13
|
+
import { u as It } from "../../useThemeProps-D4or2IlT.js";
|
|
14
|
+
import { u as Ct } from "../../useTheme-CD5DEi5n.js";
|
|
15
|
+
import { u as Nt } from "../../useId-BHG98T5I.js";
|
|
16
|
+
import { a as Ot } from "../../ButtonBase-C7CHOX3y.js";
|
|
17
|
+
import { u as ye } from "../../createSvgIcon-R_PakhKf.js";
|
|
18
|
+
import { o as Tt } from "../../ownerDocument-CUrv0DIK.js";
|
|
19
|
+
function Rt(d) {
|
|
20
|
+
return dt("MuiTreeView", d);
|
|
26
21
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return () => null;
|
|
30
|
-
const b = d ? Tt({}, d.propTypes) : null;
|
|
31
|
-
return (T) => (O, E, M, N, $, ...z) => {
|
|
32
|
-
const A = $ || E, w = b == null ? void 0 : b[A];
|
|
33
|
-
if (w) {
|
|
34
|
-
const m = w(O, E, M, N, $, ...z);
|
|
35
|
-
if (m)
|
|
36
|
-
return m;
|
|
37
|
-
}
|
|
38
|
-
return typeof O[E] < "u" && !O[T] ? new Error(`The prop \`${A}\` of \`${i}\` can only be used together with the \`${T}\` prop.`) : null;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
const vt = {
|
|
42
|
-
configure: (i) => {
|
|
43
|
-
process.env.NODE_ENV !== "production" && console.warn(["MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.", "", "You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead", "", "The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401", "", "The updated documentation: https://mui.com/guides/classname-generator/"].join(`
|
|
44
|
-
`)), gt.configure(i);
|
|
45
|
-
}
|
|
46
|
-
}, Gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
47
|
-
__proto__: null,
|
|
48
|
-
capitalize: St,
|
|
49
|
-
createChainedFunction: Nt,
|
|
50
|
-
createSvgIcon: wt,
|
|
51
|
-
debounce: It,
|
|
52
|
-
deprecatedPropType: Bt,
|
|
53
|
-
isMuiElement: Pt,
|
|
54
|
-
ownerDocument: Pe,
|
|
55
|
-
ownerWindow: Ct,
|
|
56
|
-
requirePropFactory: Ut,
|
|
57
|
-
setRef: Ot,
|
|
58
|
-
unstable_ClassNameGenerator: vt,
|
|
59
|
-
unstable_useEnhancedEffect: Et,
|
|
60
|
-
unstable_useId: Re,
|
|
61
|
-
unsupportedProp: kt,
|
|
62
|
-
useControlled: le,
|
|
63
|
-
useEventCallback: Rt,
|
|
64
|
-
useForkRef: _e,
|
|
65
|
-
useIsFocusVisible: _t
|
|
66
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
67
|
-
function Wt(i) {
|
|
68
|
-
return bt("MuiTreeView", i);
|
|
69
|
-
}
|
|
70
|
-
Lt("MuiTreeView", ["root"]);
|
|
71
|
-
const Ht = (i) => {
|
|
22
|
+
wt("MuiTreeView", ["root"]);
|
|
23
|
+
const kt = (d) => {
|
|
72
24
|
const {
|
|
73
|
-
classes:
|
|
74
|
-
} =
|
|
75
|
-
return
|
|
25
|
+
classes: b
|
|
26
|
+
} = d;
|
|
27
|
+
return yt({
|
|
76
28
|
root: ["root"]
|
|
77
|
-
},
|
|
78
|
-
},
|
|
29
|
+
}, Rt, b);
|
|
30
|
+
}, Et = ft("ul", {
|
|
79
31
|
name: "MuiTreeView",
|
|
80
32
|
slot: "Root",
|
|
81
|
-
overridesResolver: (
|
|
33
|
+
overridesResolver: (d, b) => b.root
|
|
82
34
|
})({
|
|
83
35
|
padding: 0,
|
|
84
36
|
margin: 0,
|
|
85
37
|
listStyle: "none",
|
|
86
38
|
outline: 0
|
|
87
39
|
});
|
|
88
|
-
function
|
|
89
|
-
return
|
|
40
|
+
function Ft(d) {
|
|
41
|
+
return d && d.length === 1 && d.match(/\S/);
|
|
90
42
|
}
|
|
91
|
-
function Ie(
|
|
92
|
-
for (let
|
|
93
|
-
if (
|
|
94
|
-
return
|
|
43
|
+
function Ie(d, b, E) {
|
|
44
|
+
for (let y = b; y < d.length; y += 1)
|
|
45
|
+
if (E === d[y])
|
|
46
|
+
return y;
|
|
95
47
|
return -1;
|
|
96
48
|
}
|
|
97
49
|
function Ce() {
|
|
98
50
|
return !1;
|
|
99
51
|
}
|
|
100
|
-
const
|
|
101
|
-
const
|
|
102
|
-
props:
|
|
52
|
+
const Pt = [], At = [], Re = /* @__PURE__ */ f.forwardRef(function(b, E) {
|
|
53
|
+
const y = It({
|
|
54
|
+
props: b,
|
|
103
55
|
name: "MuiTreeView"
|
|
104
56
|
}), {
|
|
105
|
-
children:
|
|
106
|
-
className:
|
|
107
|
-
defaultCollapseIcon:
|
|
108
|
-
defaultEndIcon:
|
|
109
|
-
defaultExpanded:
|
|
110
|
-
defaultExpandIcon:
|
|
111
|
-
defaultParentIcon:
|
|
112
|
-
defaultSelected:
|
|
113
|
-
disabledItemsFocusable:
|
|
114
|
-
disableSelection:
|
|
115
|
-
expanded:
|
|
116
|
-
id:
|
|
117
|
-
multiSelect:
|
|
118
|
-
onBlur:
|
|
119
|
-
onFocus:
|
|
120
|
-
onKeyDown:
|
|
121
|
-
onNodeFocus:
|
|
122
|
-
onNodeSelect:
|
|
123
|
-
onNodeToggle:
|
|
124
|
-
selected:
|
|
125
|
-
...
|
|
126
|
-
} =
|
|
127
|
-
...
|
|
128
|
-
defaultExpanded:
|
|
129
|
-
defaultSelected:
|
|
130
|
-
disabledItemsFocusable:
|
|
131
|
-
disableSelection:
|
|
132
|
-
multiSelect:
|
|
133
|
-
},
|
|
134
|
-
controlled:
|
|
135
|
-
default:
|
|
57
|
+
children: $,
|
|
58
|
+
className: Y,
|
|
59
|
+
defaultCollapseIcon: Z,
|
|
60
|
+
defaultEndIcon: v,
|
|
61
|
+
defaultExpanded: A = Pt,
|
|
62
|
+
defaultExpandIcon: ee,
|
|
63
|
+
defaultParentIcon: te,
|
|
64
|
+
defaultSelected: q = At,
|
|
65
|
+
disabledItemsFocusable: N = !1,
|
|
66
|
+
disableSelection: g = !1,
|
|
67
|
+
expanded: ie,
|
|
68
|
+
id: I,
|
|
69
|
+
multiSelect: p = !1,
|
|
70
|
+
onBlur: D,
|
|
71
|
+
onFocus: U,
|
|
72
|
+
onKeyDown: z,
|
|
73
|
+
onNodeFocus: ue,
|
|
74
|
+
onNodeSelect: O,
|
|
75
|
+
onNodeToggle: W,
|
|
76
|
+
selected: Fe,
|
|
77
|
+
...Pe
|
|
78
|
+
} = y, de = Ct().direction === "rtl", fe = {
|
|
79
|
+
...y,
|
|
80
|
+
defaultExpanded: A,
|
|
81
|
+
defaultSelected: q,
|
|
82
|
+
disabledItemsFocusable: N,
|
|
83
|
+
disableSelection: g,
|
|
84
|
+
multiSelect: p
|
|
85
|
+
}, Ae = kt(fe), pe = Nt(I), re = f.useRef(null), De = Ot(re, E), [a, ne] = f.useState(null), i = f.useRef({}), j = f.useRef({}), [F, he] = ye({
|
|
86
|
+
controlled: ie,
|
|
87
|
+
default: A,
|
|
136
88
|
name: "TreeView",
|
|
137
89
|
state: "expanded"
|
|
138
|
-
}), [
|
|
139
|
-
controlled:
|
|
140
|
-
default:
|
|
90
|
+
}), [h, H] = ye({
|
|
91
|
+
controlled: Fe,
|
|
92
|
+
default: q,
|
|
141
93
|
name: "TreeView",
|
|
142
94
|
state: "selected"
|
|
143
|
-
}),
|
|
144
|
-
let t =
|
|
95
|
+
}), T = f.useCallback((e) => Array.isArray(F) ? F.indexOf(e) !== -1 : !1, [F]), G = f.useCallback((e) => i.current[e] && i.current[e].expandable, []), Me = f.useCallback((e) => Array.isArray(h) ? h.indexOf(e) !== -1 : h === e, [h]), m = f.useCallback((e) => {
|
|
96
|
+
let t = i.current[e];
|
|
145
97
|
if (!t)
|
|
146
98
|
return !1;
|
|
147
99
|
if (t.disabled)
|
|
148
100
|
return !0;
|
|
149
101
|
for (; t.parentId != null; )
|
|
150
|
-
if (t =
|
|
102
|
+
if (t = i.current[t.parentId], t.disabled)
|
|
151
103
|
return !0;
|
|
152
104
|
return !1;
|
|
153
|
-
}, []),
|
|
154
|
-
let t =
|
|
155
|
-
return
|
|
156
|
-
},
|
|
157
|
-
if (
|
|
158
|
-
return
|
|
159
|
-
let t =
|
|
105
|
+
}, []), _e = (e) => a === e, J = (e) => Object.keys(i.current).map((t) => i.current[t]).filter((t) => t.parentId === e).sort((t, r) => t.index - r.index).map((t) => t.id), S = (e) => {
|
|
106
|
+
let t = J(e);
|
|
107
|
+
return N || (t = t.filter((r) => !m(r))), t;
|
|
108
|
+
}, Q = (e) => {
|
|
109
|
+
if (T(e) && S(e).length > 0)
|
|
110
|
+
return S(e)[0];
|
|
111
|
+
let t = i.current[e];
|
|
160
112
|
for (; t != null; ) {
|
|
161
|
-
const r =
|
|
113
|
+
const r = S(t.parentId), n = r[r.indexOf(t.id) + 1];
|
|
162
114
|
if (n)
|
|
163
115
|
return n;
|
|
164
|
-
t =
|
|
116
|
+
t = i.current[t.parentId];
|
|
165
117
|
}
|
|
166
118
|
return null;
|
|
167
119
|
}, se = (e) => {
|
|
168
|
-
const t =
|
|
120
|
+
const t = i.current[e], r = S(t.parentId), n = r.indexOf(e);
|
|
169
121
|
if (n === 0)
|
|
170
122
|
return t.parentId;
|
|
171
123
|
let s = r[n - 1];
|
|
172
|
-
for (;
|
|
173
|
-
s =
|
|
124
|
+
for (; T(s) && S(s).length > 0; )
|
|
125
|
+
s = S(s).pop();
|
|
174
126
|
return s;
|
|
175
127
|
}, oe = () => {
|
|
176
|
-
let e =
|
|
177
|
-
for (;
|
|
178
|
-
e =
|
|
128
|
+
let e = S(null).pop();
|
|
129
|
+
for (; T(e); )
|
|
130
|
+
e = S(e).pop();
|
|
179
131
|
return e;
|
|
180
|
-
}, ae = () =>
|
|
132
|
+
}, ae = () => S(null)[0], je = (e) => i.current[e].parentId, Ve = (e, t) => {
|
|
181
133
|
if (e === t)
|
|
182
134
|
return [e, t];
|
|
183
|
-
const r =
|
|
135
|
+
const r = i.current[e], n = i.current[t];
|
|
184
136
|
if (r.parentId === n.id || n.parentId === r.id)
|
|
185
137
|
return n.parentId === r.id ? [r.id, n.id] : [n.id, r.id];
|
|
186
138
|
const s = [r.id], c = [n.id];
|
|
187
|
-
let l = r.parentId,
|
|
188
|
-
for (; !
|
|
189
|
-
|
|
190
|
-
const
|
|
191
|
-
return
|
|
192
|
-
},
|
|
193
|
-
const [r, n] =
|
|
139
|
+
let l = r.parentId, u = n.parentId, x = c.indexOf(l) !== -1, K = s.indexOf(u) !== -1, _ = !0, L = !0;
|
|
140
|
+
for (; !K && !x; )
|
|
141
|
+
_ && (s.push(l), x = c.indexOf(l) !== -1, _ = l !== null, !x && _ && (l = i.current[l].parentId)), L && !x && (c.push(u), K = s.indexOf(u) !== -1, L = u !== null, !K && L && (u = i.current[u].parentId));
|
|
142
|
+
const B = x ? l : u, be = J(B), ct = s[s.indexOf(B) - 1], lt = c[c.indexOf(B) - 1];
|
|
143
|
+
return be.indexOf(ct) < be.indexOf(lt) ? [e, t] : [t, e];
|
|
144
|
+
}, Ke = (e, t) => {
|
|
145
|
+
const [r, n] = Ve(e, t), s = [r];
|
|
194
146
|
let c = r;
|
|
195
147
|
for (; c !== n; )
|
|
196
|
-
c =
|
|
148
|
+
c = Q(c), s.push(c);
|
|
197
149
|
return s;
|
|
198
|
-
},
|
|
199
|
-
t && (ne(t),
|
|
200
|
-
},
|
|
150
|
+
}, R = (e, t) => {
|
|
151
|
+
t && (ne(t), ue && ue(e, t));
|
|
152
|
+
}, me = (e, t) => R(e, Q(t)), Le = (e, t) => R(e, se(t)), Be = (e) => R(e, ae()), $e = (e) => R(e, oe()), qe = (e, t, r) => {
|
|
201
153
|
let n, s;
|
|
202
|
-
const c = r.toLowerCase(), l = [],
|
|
203
|
-
Object.keys(
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
}), n = l.indexOf(t) + 1, n >= l.length && (n = 0), s = Ie(
|
|
207
|
-
},
|
|
154
|
+
const c = r.toLowerCase(), l = [], u = [];
|
|
155
|
+
Object.keys(j.current).forEach((x) => {
|
|
156
|
+
const K = j.current[x], _ = i.current[x], L = _.parentId ? T(_.parentId) : !0, B = N ? !1 : m(x);
|
|
157
|
+
L && !B && (l.push(x), u.push(K));
|
|
158
|
+
}), n = l.indexOf(t) + 1, n >= l.length && (n = 0), s = Ie(u, n, c), s === -1 && (s = Ie(u, 0, c)), s > -1 && R(e, l[s]);
|
|
159
|
+
}, X = (e, t = a) => {
|
|
208
160
|
let r;
|
|
209
|
-
|
|
210
|
-
},
|
|
211
|
-
const r =
|
|
212
|
-
s.length > 0 && (
|
|
213
|
-
},
|
|
214
|
-
let r =
|
|
161
|
+
F.indexOf(t) !== -1 ? r = F.filter((n) => n !== t) : r = [t].concat(F), W && W(e, r), he(r);
|
|
162
|
+
}, Ue = (e, t) => {
|
|
163
|
+
const r = i.current[t], s = J(r.parentId).filter((l) => G(l) && !T(l)), c = F.concat(s);
|
|
164
|
+
s.length > 0 && (he(c), W && W(e, c));
|
|
165
|
+
}, k = f.useRef(null), M = f.useRef(!1), w = f.useRef([]), ze = (e, t) => {
|
|
166
|
+
let r = h.slice();
|
|
215
167
|
const {
|
|
216
168
|
start: n,
|
|
217
169
|
next: s,
|
|
218
170
|
current: c
|
|
219
171
|
} = t;
|
|
220
|
-
!s || !c || (
|
|
221
|
-
},
|
|
222
|
-
let r =
|
|
172
|
+
!s || !c || (w.current.indexOf(c) === -1 && (w.current = []), M.current ? w.current.indexOf(s) !== -1 ? (r = r.filter((l) => l === n || l !== c), w.current = w.current.filter((l) => l === n || l !== c)) : (r.push(s), w.current.push(s)) : (r.push(s), w.current.push(c, s)), O && O(e, r), H(r));
|
|
173
|
+
}, We = (e, t) => {
|
|
174
|
+
let r = h.slice();
|
|
223
175
|
const {
|
|
224
176
|
start: n,
|
|
225
177
|
end: s
|
|
226
178
|
} = t;
|
|
227
|
-
|
|
228
|
-
let c =
|
|
229
|
-
c = c.filter((
|
|
179
|
+
M.current && (r = r.filter((u) => w.current.indexOf(u) === -1));
|
|
180
|
+
let c = Ke(n, s);
|
|
181
|
+
c = c.filter((u) => !m(u)), w.current = c;
|
|
230
182
|
let l = r.concat(c);
|
|
231
|
-
l = l.filter((
|
|
232
|
-
},
|
|
183
|
+
l = l.filter((u, x) => l.indexOf(u) === x), O && O(e, l), H(l);
|
|
184
|
+
}, He = (e, t) => {
|
|
233
185
|
let r;
|
|
234
|
-
|
|
235
|
-
},
|
|
236
|
-
const r =
|
|
237
|
-
|
|
238
|
-
},
|
|
186
|
+
h.indexOf(t) !== -1 ? r = h.filter((n) => n !== t) : r = [t].concat(h), O && O(e, r), H(r);
|
|
187
|
+
}, Ge = (e, t) => {
|
|
188
|
+
const r = p ? [t] : t;
|
|
189
|
+
O && O(e, r), H(r);
|
|
190
|
+
}, V = (e, t, r = !1) => t ? (r ? He(e, t) : Ge(e, t), k.current = t, M.current = !1, w.current = [], !0) : !1, P = (e, t, r = !1) => {
|
|
239
191
|
const {
|
|
240
|
-
start: n =
|
|
192
|
+
start: n = k.current,
|
|
241
193
|
end: s,
|
|
242
194
|
current: c
|
|
243
195
|
} = t;
|
|
244
|
-
r ?
|
|
196
|
+
r ? ze(e, {
|
|
245
197
|
start: n,
|
|
246
198
|
next: s,
|
|
247
199
|
current: c
|
|
248
|
-
}) : n != null && s != null &&
|
|
200
|
+
}) : n != null && s != null && We(e, {
|
|
249
201
|
start: n,
|
|
250
202
|
end: s
|
|
251
|
-
}),
|
|
252
|
-
},
|
|
253
|
-
|
|
254
|
-
const r =
|
|
255
|
-
|
|
203
|
+
}), M.current = !0;
|
|
204
|
+
}, Je = (e, t) => {
|
|
205
|
+
k.current || (k.current = t);
|
|
206
|
+
const r = M.current ? k.current : t;
|
|
207
|
+
P(e, {
|
|
256
208
|
start: r,
|
|
257
209
|
end: ae()
|
|
258
210
|
});
|
|
259
|
-
},
|
|
260
|
-
|
|
261
|
-
const r =
|
|
262
|
-
|
|
211
|
+
}, Qe = (e, t) => {
|
|
212
|
+
k.current || (k.current = t);
|
|
213
|
+
const r = M.current ? k.current : t;
|
|
214
|
+
P(e, {
|
|
263
215
|
start: r,
|
|
264
216
|
end: oe()
|
|
265
217
|
});
|
|
266
|
-
},
|
|
267
|
-
|
|
268
|
-
end:
|
|
218
|
+
}, Xe = (e, t) => {
|
|
219
|
+
m(Q(t)) || P(e, {
|
|
220
|
+
end: Q(t),
|
|
269
221
|
current: t
|
|
270
222
|
}, !0);
|
|
271
|
-
},
|
|
272
|
-
|
|
223
|
+
}, Ye = (e, t) => {
|
|
224
|
+
m(se(t)) || P(e, {
|
|
273
225
|
end: se(t),
|
|
274
226
|
current: t
|
|
275
227
|
}, !0);
|
|
276
|
-
},
|
|
277
|
-
|
|
228
|
+
}, Ze = (e) => {
|
|
229
|
+
P(e, {
|
|
278
230
|
start: ae(),
|
|
279
231
|
end: oe()
|
|
280
232
|
});
|
|
281
|
-
},
|
|
233
|
+
}, ve = f.useCallback((e) => {
|
|
282
234
|
const {
|
|
283
235
|
id: t,
|
|
284
236
|
index: r,
|
|
@@ -287,7 +239,7 @@ const Qt = [], Xt = [], ke = /* @__PURE__ */ p.forwardRef(function(d, b) {
|
|
|
287
239
|
idAttribute: c,
|
|
288
240
|
disabled: l
|
|
289
241
|
} = e;
|
|
290
|
-
|
|
242
|
+
i.current[t] = {
|
|
291
243
|
id: t,
|
|
292
244
|
index: r,
|
|
293
245
|
parentId: n,
|
|
@@ -295,24 +247,24 @@ const Qt = [], Xt = [], ke = /* @__PURE__ */ p.forwardRef(function(d, b) {
|
|
|
295
247
|
idAttribute: c,
|
|
296
248
|
disabled: l
|
|
297
249
|
};
|
|
298
|
-
}, []),
|
|
250
|
+
}, []), et = f.useCallback((e) => {
|
|
299
251
|
const t = {
|
|
300
|
-
...
|
|
252
|
+
...i.current
|
|
301
253
|
};
|
|
302
|
-
delete t[e],
|
|
303
|
-
}, []),
|
|
304
|
-
|
|
305
|
-
}, []),
|
|
254
|
+
delete t[e], i.current = t, ne((r) => r === e && re.current === Tt(re.current).activeElement ? J(null)[0] : r);
|
|
255
|
+
}, []), tt = f.useCallback((e, t) => {
|
|
256
|
+
j.current[e] = t;
|
|
257
|
+
}, []), rt = f.useCallback((e) => {
|
|
306
258
|
const t = {
|
|
307
|
-
...
|
|
259
|
+
...j.current
|
|
308
260
|
};
|
|
309
|
-
delete t[e],
|
|
310
|
-
}, []), xe = (e) => (
|
|
311
|
-
if (
|
|
312
|
-
return
|
|
313
|
-
const t =
|
|
314
|
-
return t ? (
|
|
315
|
-
},
|
|
261
|
+
delete t[e], j.current = t;
|
|
262
|
+
}, []), xe = (e) => (G(a) && (T(a) ? me(e, a) : m(a) || X(e)), !0), ge = (e) => {
|
|
263
|
+
if (T(a) && !m(a))
|
|
264
|
+
return X(e, a), !0;
|
|
265
|
+
const t = je(a);
|
|
266
|
+
return t ? (R(e, t), !0) : !1;
|
|
267
|
+
}, nt = (e) => {
|
|
316
268
|
let t = !1;
|
|
317
269
|
const r = e.key;
|
|
318
270
|
if (e.altKey || e.currentTarget !== e.target || !a)
|
|
@@ -320,91 +272,91 @@ const Qt = [], Xt = [], ke = /* @__PURE__ */ p.forwardRef(function(d, b) {
|
|
|
320
272
|
const n = e.ctrlKey || e.metaKey;
|
|
321
273
|
switch (r) {
|
|
322
274
|
case " ":
|
|
323
|
-
!
|
|
275
|
+
!g && !m(a) && (p && e.shiftKey ? (P(e, {
|
|
324
276
|
end: a
|
|
325
|
-
}), t = !0) :
|
|
277
|
+
}), t = !0) : p ? t = V(e, a, !0) : t = V(e, a)), e.stopPropagation();
|
|
326
278
|
break;
|
|
327
279
|
case "Enter":
|
|
328
|
-
|
|
280
|
+
m(a) || (G(a) ? (X(e), t = !0) : p ? t = V(e, a, !0) : t = V(e, a)), e.stopPropagation();
|
|
329
281
|
break;
|
|
330
282
|
case "ArrowDown":
|
|
331
|
-
|
|
283
|
+
p && e.shiftKey && !g && Xe(e, a), me(e, a), t = !0;
|
|
332
284
|
break;
|
|
333
285
|
case "ArrowUp":
|
|
334
|
-
|
|
286
|
+
p && e.shiftKey && !g && Ye(e, a), Le(e, a), t = !0;
|
|
335
287
|
break;
|
|
336
288
|
case "ArrowRight":
|
|
337
|
-
|
|
289
|
+
de ? t = ge(e) : t = xe(e);
|
|
338
290
|
break;
|
|
339
291
|
case "ArrowLeft":
|
|
340
|
-
|
|
292
|
+
de ? t = xe(e) : t = ge(e);
|
|
341
293
|
break;
|
|
342
294
|
case "Home":
|
|
343
|
-
|
|
295
|
+
p && n && e.shiftKey && !g && !m(a) && Je(e, a), Be(e), t = !0;
|
|
344
296
|
break;
|
|
345
297
|
case "End":
|
|
346
|
-
|
|
298
|
+
p && n && e.shiftKey && !g && !m(a) && Qe(e, a), $e(e), t = !0;
|
|
347
299
|
break;
|
|
348
300
|
default:
|
|
349
|
-
r === "*" ? (
|
|
301
|
+
r === "*" ? (Ue(e, a), t = !0) : p && n && r.toLowerCase() === "a" && !g ? (Ze(e), t = !0) : !n && !e.shiftKey && Ft(r) && (qe(e, a, r), t = !0);
|
|
350
302
|
}
|
|
351
|
-
t && (e.preventDefault(), e.stopPropagation()),
|
|
352
|
-
},
|
|
303
|
+
t && (e.preventDefault(), e.stopPropagation()), z && z(e);
|
|
304
|
+
}, st = (e) => {
|
|
353
305
|
if (e.target === e.currentTarget) {
|
|
354
|
-
const t = Array.isArray(
|
|
355
|
-
|
|
306
|
+
const t = Array.isArray(h) ? h[0] : h;
|
|
307
|
+
R(e, t || S(null)[0]);
|
|
356
308
|
}
|
|
357
|
-
|
|
358
|
-
},
|
|
359
|
-
ne(null),
|
|
360
|
-
},
|
|
361
|
-
return /* @__PURE__ */
|
|
309
|
+
U && U(e);
|
|
310
|
+
}, ot = (e) => {
|
|
311
|
+
ne(null), D && D(e);
|
|
312
|
+
}, at = i.current[a] ? i.current[a].idAttribute : null;
|
|
313
|
+
return /* @__PURE__ */ C(pt.Provider, {
|
|
362
314
|
// TODO: fix this lint error
|
|
363
315
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
364
316
|
value: {
|
|
365
317
|
icons: {
|
|
366
|
-
defaultCollapseIcon:
|
|
367
|
-
defaultExpandIcon:
|
|
368
|
-
defaultParentIcon:
|
|
369
|
-
defaultEndIcon:
|
|
318
|
+
defaultCollapseIcon: Z,
|
|
319
|
+
defaultExpandIcon: ee,
|
|
320
|
+
defaultParentIcon: te,
|
|
321
|
+
defaultEndIcon: v
|
|
370
322
|
},
|
|
371
|
-
focus:
|
|
372
|
-
toggleExpansion:
|
|
373
|
-
isExpanded:
|
|
374
|
-
isExpandable:
|
|
375
|
-
isFocused:
|
|
376
|
-
isSelected:
|
|
377
|
-
isDisabled:
|
|
378
|
-
selectNode:
|
|
379
|
-
selectRange:
|
|
380
|
-
multiSelect:
|
|
381
|
-
disabledItemsFocusable:
|
|
382
|
-
mapFirstChar:
|
|
383
|
-
unMapFirstChar:
|
|
384
|
-
registerNode:
|
|
385
|
-
unregisterNode:
|
|
386
|
-
treeId:
|
|
323
|
+
focus: R,
|
|
324
|
+
toggleExpansion: X,
|
|
325
|
+
isExpanded: T,
|
|
326
|
+
isExpandable: G,
|
|
327
|
+
isFocused: _e,
|
|
328
|
+
isSelected: Me,
|
|
329
|
+
isDisabled: m,
|
|
330
|
+
selectNode: g ? Ce : V,
|
|
331
|
+
selectRange: g ? Ce : P,
|
|
332
|
+
multiSelect: p,
|
|
333
|
+
disabledItemsFocusable: N,
|
|
334
|
+
mapFirstChar: tt,
|
|
335
|
+
unMapFirstChar: rt,
|
|
336
|
+
registerNode: ve,
|
|
337
|
+
unregisterNode: et,
|
|
338
|
+
treeId: pe
|
|
387
339
|
},
|
|
388
|
-
children: /* @__PURE__ */
|
|
389
|
-
children: /* @__PURE__ */
|
|
340
|
+
children: /* @__PURE__ */ C(ht, {
|
|
341
|
+
children: /* @__PURE__ */ C(Et, {
|
|
390
342
|
role: "tree",
|
|
391
|
-
id:
|
|
392
|
-
"aria-activedescendant":
|
|
393
|
-
"aria-multiselectable":
|
|
394
|
-
className:
|
|
395
|
-
ref:
|
|
343
|
+
id: pe,
|
|
344
|
+
"aria-activedescendant": at,
|
|
345
|
+
"aria-multiselectable": p,
|
|
346
|
+
className: mt(Ae.root, Y),
|
|
347
|
+
ref: De,
|
|
396
348
|
tabIndex: 0,
|
|
397
|
-
onKeyDown:
|
|
398
|
-
onFocus:
|
|
399
|
-
onBlur:
|
|
400
|
-
ownerState:
|
|
401
|
-
...
|
|
402
|
-
children:
|
|
349
|
+
onKeyDown: nt,
|
|
350
|
+
onFocus: st,
|
|
351
|
+
onBlur: ot,
|
|
352
|
+
ownerState: fe,
|
|
353
|
+
...Pe,
|
|
354
|
+
children: $
|
|
403
355
|
})
|
|
404
356
|
})
|
|
405
357
|
});
|
|
406
358
|
});
|
|
407
|
-
process.env.NODE_ENV !== "production" && (
|
|
359
|
+
process.env.NODE_ENV !== "production" && (Re.propTypes = {
|
|
408
360
|
// ----------------------------- Warning --------------------------------
|
|
409
361
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
410
362
|
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
@@ -518,57 +470,40 @@ process.env.NODE_ENV !== "production" && (ke.propTypes = {
|
|
|
518
470
|
*/
|
|
519
471
|
sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object])
|
|
520
472
|
});
|
|
521
|
-
var
|
|
522
|
-
|
|
523
|
-
var Te;
|
|
524
|
-
function Fe() {
|
|
525
|
-
return Te || (Te = 1, function(i) {
|
|
526
|
-
"use client";
|
|
527
|
-
Object.defineProperty(i, "__esModule", {
|
|
528
|
-
value: !0
|
|
529
|
-
}), Object.defineProperty(i, "default", {
|
|
530
|
-
enumerable: !0,
|
|
531
|
-
get: function() {
|
|
532
|
-
return d.createSvgIcon;
|
|
533
|
-
}
|
|
534
|
-
});
|
|
535
|
-
var d = Zt;
|
|
536
|
-
}(ce)), ce;
|
|
537
|
-
}
|
|
538
|
-
var er = Ee;
|
|
539
|
-
Object.defineProperty(ie, "__esModule", {
|
|
473
|
+
var ce = {}, Dt = Oe;
|
|
474
|
+
Object.defineProperty(ce, "__esModule", {
|
|
540
475
|
value: !0
|
|
541
476
|
});
|
|
542
|
-
var
|
|
543
|
-
|
|
477
|
+
var ke = ce.default = void 0, Mt = Dt(Te()), _t = Ne;
|
|
478
|
+
ke = ce.default = (0, Mt.default)(/* @__PURE__ */ (0, _t.jsx)("path", {
|
|
544
479
|
d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
|
|
545
480
|
}), "ExpandMore");
|
|
546
|
-
var
|
|
547
|
-
Object.defineProperty(
|
|
481
|
+
var le = {}, jt = Oe;
|
|
482
|
+
Object.defineProperty(le, "__esModule", {
|
|
548
483
|
value: !0
|
|
549
484
|
});
|
|
550
|
-
var
|
|
551
|
-
|
|
485
|
+
var Ee = le.default = void 0, Vt = jt(Te()), Kt = Ne;
|
|
486
|
+
Ee = le.default = (0, Vt.default)(/* @__PURE__ */ (0, Kt.jsx)("path", {
|
|
552
487
|
d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
|
|
553
488
|
}), "ChevronRight");
|
|
554
|
-
const
|
|
555
|
-
data:
|
|
556
|
-
idKey:
|
|
557
|
-
selected:
|
|
558
|
-
expanded:
|
|
559
|
-
disabled:
|
|
560
|
-
disableSearch:
|
|
561
|
-
onChange:
|
|
562
|
-
onToggle:
|
|
489
|
+
const nr = ({
|
|
490
|
+
data: d,
|
|
491
|
+
idKey: b = "id",
|
|
492
|
+
selected: E,
|
|
493
|
+
expanded: y,
|
|
494
|
+
disabled: $,
|
|
495
|
+
disableSearch: Y,
|
|
496
|
+
onChange: Z,
|
|
497
|
+
onToggle: v
|
|
563
498
|
}) => {
|
|
564
|
-
const [
|
|
565
|
-
(
|
|
566
|
-
) :
|
|
567
|
-
let
|
|
568
|
-
const
|
|
569
|
-
return /* @__PURE__ */
|
|
570
|
-
!
|
|
571
|
-
|
|
499
|
+
const [A, ee] = Se.useState(""), te = St(d), q = Se.useMemo(() => A.length > 0 ? te.filter(
|
|
500
|
+
(I) => I.name.toLowerCase().includes(A)
|
|
501
|
+
) : d, [A, d]);
|
|
502
|
+
let N = null;
|
|
503
|
+
const g = 500;
|
|
504
|
+
return /* @__PURE__ */ it(ut, { children: [
|
|
505
|
+
!Y && /* @__PURE__ */ C(gt, { px: 1, children: /* @__PURE__ */ C(
|
|
506
|
+
bt,
|
|
572
507
|
{
|
|
573
508
|
fullWidth: !0,
|
|
574
509
|
disableLabel: !0,
|
|
@@ -580,36 +515,36 @@ const Or = ({
|
|
|
580
515
|
}
|
|
581
516
|
},
|
|
582
517
|
iconSize: "small",
|
|
583
|
-
onChange: (
|
|
584
|
-
|
|
518
|
+
onChange: (I) => {
|
|
519
|
+
N && clearTimeout(N), N = setTimeout(() => ee(I.toLowerCase()), g);
|
|
585
520
|
}
|
|
586
521
|
}
|
|
587
522
|
) }),
|
|
588
|
-
/* @__PURE__ */
|
|
589
|
-
|
|
523
|
+
/* @__PURE__ */ C(
|
|
524
|
+
Re,
|
|
590
525
|
{
|
|
591
526
|
"aria-label": "tree view filter",
|
|
592
|
-
defaultCollapseIcon: /* @__PURE__ */
|
|
593
|
-
defaultExpandIcon: /* @__PURE__ */
|
|
527
|
+
defaultCollapseIcon: /* @__PURE__ */ C(ke, {}),
|
|
528
|
+
defaultExpandIcon: /* @__PURE__ */ C(Ee, {}),
|
|
594
529
|
disableSelection: !0,
|
|
595
|
-
expanded:
|
|
596
|
-
onNodeToggle:
|
|
597
|
-
children:
|
|
598
|
-
const
|
|
599
|
-
return /* @__PURE__ */
|
|
600
|
-
|
|
530
|
+
expanded: y,
|
|
531
|
+
onNodeToggle: v,
|
|
532
|
+
children: q.map((I, p) => {
|
|
533
|
+
const D = String(I[b]), U = we.includes(E, D), z = we.includes($, D);
|
|
534
|
+
return /* @__PURE__ */ C(
|
|
535
|
+
xt,
|
|
601
536
|
{
|
|
602
|
-
id:
|
|
603
|
-
idKey:
|
|
604
|
-
name:
|
|
605
|
-
checked:
|
|
606
|
-
disabled:
|
|
607
|
-
disabledIds:
|
|
608
|
-
children:
|
|
609
|
-
onChange:
|
|
610
|
-
defaultSelected:
|
|
537
|
+
id: D,
|
|
538
|
+
idKey: b,
|
|
539
|
+
name: I.name,
|
|
540
|
+
checked: U,
|
|
541
|
+
disabled: z,
|
|
542
|
+
disabledIds: $,
|
|
543
|
+
children: I.children,
|
|
544
|
+
onChange: Z,
|
|
545
|
+
defaultSelected: E
|
|
611
546
|
},
|
|
612
|
-
|
|
547
|
+
p
|
|
613
548
|
);
|
|
614
549
|
})
|
|
615
550
|
}
|
|
@@ -617,5 +552,5 @@ const Or = ({
|
|
|
617
552
|
] });
|
|
618
553
|
};
|
|
619
554
|
export {
|
|
620
|
-
|
|
555
|
+
nr as TreeViewFilter
|
|
621
556
|
};
|