@hybridcore/ui 1.0.2 → 1.1.2
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 +967 -0
- package/dist/CardContent-C8PxkJz4.js +73 -0
- package/dist/Checkbox-DostZSwR.js +673 -0
- package/dist/DialogContent-2aPOjKE7.js +2025 -0
- package/dist/FormControl-BiAFm76F.js +1491 -0
- package/dist/IconButton-CQJ8wZE8.js +183 -0
- package/dist/Input-Bf5G3tFN.js +324 -0
- package/dist/OutlinedInput-BEVE8VZQ.js +452 -0
- package/dist/Paper-CaiWdndQ.js +162 -0
- package/dist/Select-DxpxZbJp.js +2526 -0
- package/dist/Source-CnCcu5UP.js +4374 -0
- package/dist/Text-BT5kPHOo.js +2192 -0
- package/dist/Typography-XIiVCSto.js +178 -0
- package/dist/assertThisInitialized-BUtkG-md.js +13 -0
- package/dist/assets/index.css +1 -0
- package/dist/assets/index2.css +1 -0
- package/dist/chainPropTypes-DtBfUj5o.js +96 -0
- package/dist/components/access/helpers.js +32 -0
- package/dist/components/access/index.js +15 -0
- package/dist/components/card/index.js +159 -469
- package/dist/components/card/styled.js +75 -7
- package/dist/components/conditional-wrapper/index.js +9 -0
- package/dist/components/confirm/dialog.js +151 -0
- package/dist/components/confirm/index.js +23 -0
- package/dist/components/container/index.js +270 -0
- package/dist/components/context-menu/index.js +973 -0
- package/dist/components/data-management/instance-form/components/composite-list/index.js +12 -0
- package/dist/components/data-management/instance-form/components/composite-list/styled.js +64 -0
- package/dist/components/data-management/instance-form/components/policy-list/index.js +86 -0
- package/dist/components/data-management/instance-form/components/variable/index.js +15 -0
- package/dist/components/data-management/instance-form/components/variables/index.js +39 -0
- package/dist/components/data-management/instance-form/index.js +437 -0
- package/dist/components/data-security-selectors/dissemination-list/index.js +3201 -0
- package/dist/components/data-security-selectors/security-level/index.js +81 -0
- package/dist/components/date-time-picker/index.js +103 -0
- package/dist/components/geometry-picker/coordinate/index.js +93 -0
- package/dist/components/geometry-picker/edit/index.js +71 -0
- package/dist/components/geometry-picker/geometry/index.js +160 -0
- package/dist/components/geometry-picker/geometry/map-overlay.js +22 -0
- package/dist/components/geometry-picker/index.js +140 -0
- package/dist/components/geometry-picker/kml/index.js +62 -0
- package/dist/components/geometry-picker/kml/select-input-method.js +75 -0
- package/dist/components/geometry-picker/logic.js +69 -0
- package/dist/components/geometry-picker/map/index.js +42 -0
- package/dist/components/geometry-picker/map/logic.js +2360 -0
- package/dist/components/geometry-picker/map/style.js +88 -0
- package/dist/components/geometry-picker/parser/coordinate-input/index.js +78 -0
- package/dist/components/geometry-picker/parser/coordinate-input/logic.js +1305 -0
- package/dist/components/geometry-picker/parser/index.js +179 -0
- package/dist/components/geometry-picker/parser/logic.js +84 -0
- package/dist/components/geometry-picker/parser/styled.js +25 -0
- package/dist/components/geometry-picker/styled.js +48 -0
- package/dist/components/geometry-picker/wkt/index.js +59 -0
- package/dist/components/geometry-picker/wkt/select-input-method.js +75 -0
- package/dist/components/icon-button/index.js +18 -0
- package/dist/components/icon-button/styled.js +51 -0
- package/dist/components/key-protection/index.js +4 -0
- package/dist/components/key-protection/menu.js +85 -0
- package/dist/components/key-protection/utils.js +10 -0
- package/dist/components/loading/index.js +7 -0
- package/dist/components/loading/styled.js +16 -0
- package/dist/components/map/helpers/kml.js +45 -0
- package/dist/components/map/helpers/mapbox.js +48 -0
- package/dist/components/map/helpers/ol.js +25 -0
- package/dist/components/map/helpers/wkt.js +29 -0
- package/dist/components/map/index.js +8 -0
- package/dist/components/map/logic.js +140 -0
- package/dist/components/map/styled.js +8 -0
- package/dist/components/phone-input/index.js +25 -0
- package/dist/components/phone-input/styled.js +26 -0
- package/dist/components/search-input/index.js +76 -0
- package/dist/components/tree-select/index.js +70 -0
- package/dist/components/tree-select/styled.js +64 -0
- package/dist/components/treeview-filter/index.js +621 -0
- package/dist/components/treeview-filter/item/index.js +7 -0
- package/dist/components/treeview-filter/item-label/index.js +44 -0
- package/dist/createTheme-agWfFD64.js +2392 -0
- package/dist/exactProp-CI8dagM-.js +36 -0
- package/dist/extends-C3382pL0.js +22 -0
- package/dist/has-9_asnBxn.js +688 -0
- package/dist/hooks/useMenuLogic.js +21 -0
- package/dist/hooks/useToggle.js +23 -0
- package/dist/index-Bw_m9ult.js +1105 -0
- package/dist/index-IvOfmM1F.js +34 -0
- package/dist/index-wW2D1aTG.js +957 -0
- package/dist/isHostComponent-kiaBvYVo.js +6 -0
- package/dist/isMuiElement-CxT3_ACP.js +13 -0
- package/dist/listItemTextClasses-BvXFz-Oc.js +132 -0
- package/dist/main.d.ts +1317 -0
- package/dist/main.js +41 -2
- package/dist/ol-DXmSLlWv.js +15041 -0
- package/dist/ownerDocument-CUrv0DIK.js +6 -0
- package/dist/ownerWindow-niciwP7I.js +7 -0
- package/dist/styled-C43K9x7T.js +229 -0
- package/dist/styled-Iq9jsO4F.js +1033 -0
- package/dist/useFormControl-CatNKXAi.js +10 -0
- package/dist/useId-BHG98T5I.js +26 -0
- package/dist/useTheme-C0Dky5rV.js +17 -0
- package/dist/useTheme-CeyGVuQP.js +10 -0
- package/dist/useThemeProps-CzAjOL6F.js +26 -0
- package/dist/utils/ontology.js +37 -0
- package/dist/utils-Bq0ye5vf.js +115 -0
- package/dist/utils-DLpkeyhZ.js +365 -0
- package/package.json +26 -5
- package/dist/styled-BG5UIpPU.js +0 -3459
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
import Oe, { jsx as _, jsxs as mt, Fragment as ht } from "react/jsx-runtime";
|
|
2
|
+
import * as p from "react";
|
|
3
|
+
import we from "react";
|
|
4
|
+
import { C as gt, g as bt, s as xt, i as Ee } from "../../styled-Iq9jsO4F.js";
|
|
5
|
+
import { c as St, P as o, k as yt } from "../../createTheme-agWfFD64.js";
|
|
6
|
+
import { c as wt, u as le } from "../../Checkbox-DostZSwR.js";
|
|
7
|
+
import { c as Nt, u as Re } from "../../useId-BHG98T5I.js";
|
|
8
|
+
import { g as It } from "../../FormControl-BiAFm76F.js";
|
|
9
|
+
import { o as Ct } from "../../ownerWindow-niciwP7I.js";
|
|
10
|
+
import { a as Tt } from "../../extends-C3382pL0.js";
|
|
11
|
+
import { s as Ot, u as Et, b as Rt, a as _e, c as _t } from "../../ButtonBase-BYmh3G5j.js";
|
|
12
|
+
import { i as Pt } from "../../isMuiElement-CxT3_ACP.js";
|
|
13
|
+
import { o as Pe } from "../../ownerDocument-CUrv0DIK.js";
|
|
14
|
+
import { u as kt, a as Ft, T as Dt, D as Mt, c as At, I as jt } from "../../index-wW2D1aTG.js";
|
|
15
|
+
import Ne from "lodash";
|
|
16
|
+
import { Box as Vt } from "@mui/material";
|
|
17
|
+
import { SearchInput as $t } from "../search-input/index.js";
|
|
18
|
+
import { flattenNestedTemplates as Kt } from "../../utils/ontology.js";
|
|
19
|
+
import { g as Lt, a as qt } from "../../chainPropTypes-DtBfUj5o.js";
|
|
20
|
+
import { u as zt } from "../../useTheme-CeyGVuQP.js";
|
|
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
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function Ut(i, d) {
|
|
28
|
+
if (process.env.NODE_ENV === "production")
|
|
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) => {
|
|
72
|
+
const {
|
|
73
|
+
classes: d
|
|
74
|
+
} = i;
|
|
75
|
+
return qt({
|
|
76
|
+
root: ["root"]
|
|
77
|
+
}, Wt, d);
|
|
78
|
+
}, Yt = xt("ul", {
|
|
79
|
+
name: "MuiTreeView",
|
|
80
|
+
slot: "Root",
|
|
81
|
+
overridesResolver: (i, d) => d.root
|
|
82
|
+
})({
|
|
83
|
+
padding: 0,
|
|
84
|
+
margin: 0,
|
|
85
|
+
listStyle: "none",
|
|
86
|
+
outline: 0
|
|
87
|
+
});
|
|
88
|
+
function Jt(i) {
|
|
89
|
+
return i && i.length === 1 && i.match(/\S/);
|
|
90
|
+
}
|
|
91
|
+
function Ie(i, d, b) {
|
|
92
|
+
for (let g = d; g < i.length; g += 1)
|
|
93
|
+
if (b === i[g])
|
|
94
|
+
return g;
|
|
95
|
+
return -1;
|
|
96
|
+
}
|
|
97
|
+
function Ce() {
|
|
98
|
+
return !1;
|
|
99
|
+
}
|
|
100
|
+
const Qt = [], Xt = [], ke = /* @__PURE__ */ p.forwardRef(function(d, b) {
|
|
101
|
+
const g = Ft({
|
|
102
|
+
props: d,
|
|
103
|
+
name: "MuiTreeView"
|
|
104
|
+
}), {
|
|
105
|
+
children: T,
|
|
106
|
+
className: O,
|
|
107
|
+
defaultCollapseIcon: E,
|
|
108
|
+
defaultEndIcon: M,
|
|
109
|
+
defaultExpanded: N = Qt,
|
|
110
|
+
defaultExpandIcon: $,
|
|
111
|
+
defaultParentIcon: z,
|
|
112
|
+
defaultSelected: A = Xt,
|
|
113
|
+
disabledItemsFocusable: w = !1,
|
|
114
|
+
disableSelection: m = !1,
|
|
115
|
+
expanded: de,
|
|
116
|
+
id: R,
|
|
117
|
+
multiSelect: h = !1,
|
|
118
|
+
onBlur: K,
|
|
119
|
+
onFocus: H,
|
|
120
|
+
onKeyDown: Y,
|
|
121
|
+
onNodeFocus: fe,
|
|
122
|
+
onNodeSelect: P,
|
|
123
|
+
onNodeToggle: J,
|
|
124
|
+
selected: Ae,
|
|
125
|
+
...je
|
|
126
|
+
} = g, pe = zt().direction === "rtl", me = {
|
|
127
|
+
...g,
|
|
128
|
+
defaultExpanded: N,
|
|
129
|
+
defaultSelected: A,
|
|
130
|
+
disabledItemsFocusable: w,
|
|
131
|
+
disableSelection: m,
|
|
132
|
+
multiSelect: h
|
|
133
|
+
}, Ve = Ht(me), he = Re(R), re = p.useRef(null), $e = _e(re, b), [a, ne] = p.useState(null), u = p.useRef({}), B = p.useRef({}), [j, ge] = le({
|
|
134
|
+
controlled: de,
|
|
135
|
+
default: N,
|
|
136
|
+
name: "TreeView",
|
|
137
|
+
state: "expanded"
|
|
138
|
+
}), [x, Q] = le({
|
|
139
|
+
controlled: Ae,
|
|
140
|
+
default: A,
|
|
141
|
+
name: "TreeView",
|
|
142
|
+
state: "selected"
|
|
143
|
+
}), k = p.useCallback((e) => Array.isArray(j) ? j.indexOf(e) !== -1 : !1, [j]), X = p.useCallback((e) => u.current[e] && u.current[e].expandable, []), Ke = p.useCallback((e) => Array.isArray(x) ? x.indexOf(e) !== -1 : x === e, [x]), S = p.useCallback((e) => {
|
|
144
|
+
let t = u.current[e];
|
|
145
|
+
if (!t)
|
|
146
|
+
return !1;
|
|
147
|
+
if (t.disabled)
|
|
148
|
+
return !0;
|
|
149
|
+
for (; t.parentId != null; )
|
|
150
|
+
if (t = u.current[t.parentId], t.disabled)
|
|
151
|
+
return !0;
|
|
152
|
+
return !1;
|
|
153
|
+
}, []), Le = (e) => a === e, Z = (e) => Object.keys(u.current).map((t) => u.current[t]).filter((t) => t.parentId === e).sort((t, r) => t.index - r.index).map((t) => t.id), I = (e) => {
|
|
154
|
+
let t = Z(e);
|
|
155
|
+
return w || (t = t.filter((r) => !S(r))), t;
|
|
156
|
+
}, ee = (e) => {
|
|
157
|
+
if (k(e) && I(e).length > 0)
|
|
158
|
+
return I(e)[0];
|
|
159
|
+
let t = u.current[e];
|
|
160
|
+
for (; t != null; ) {
|
|
161
|
+
const r = I(t.parentId), n = r[r.indexOf(t.id) + 1];
|
|
162
|
+
if (n)
|
|
163
|
+
return n;
|
|
164
|
+
t = u.current[t.parentId];
|
|
165
|
+
}
|
|
166
|
+
return null;
|
|
167
|
+
}, se = (e) => {
|
|
168
|
+
const t = u.current[e], r = I(t.parentId), n = r.indexOf(e);
|
|
169
|
+
if (n === 0)
|
|
170
|
+
return t.parentId;
|
|
171
|
+
let s = r[n - 1];
|
|
172
|
+
for (; k(s) && I(s).length > 0; )
|
|
173
|
+
s = I(s).pop();
|
|
174
|
+
return s;
|
|
175
|
+
}, oe = () => {
|
|
176
|
+
let e = I(null).pop();
|
|
177
|
+
for (; k(e); )
|
|
178
|
+
e = I(e).pop();
|
|
179
|
+
return e;
|
|
180
|
+
}, ae = () => I(null)[0], qe = (e) => u.current[e].parentId, ze = (e, t) => {
|
|
181
|
+
if (e === t)
|
|
182
|
+
return [e, t];
|
|
183
|
+
const r = u.current[e], n = u.current[t];
|
|
184
|
+
if (r.parentId === n.id || n.parentId === r.id)
|
|
185
|
+
return n.parentId === r.id ? [r.id, n.id] : [n.id, r.id];
|
|
186
|
+
const s = [r.id], c = [n.id];
|
|
187
|
+
let l = r.parentId, f = n.parentId, y = c.indexOf(l) !== -1, v = s.indexOf(f) !== -1, q = !0, G = !0;
|
|
188
|
+
for (; !v && !y; )
|
|
189
|
+
q && (s.push(l), y = c.indexOf(l) !== -1, q = l !== null, !y && q && (l = u.current[l].parentId)), G && !y && (c.push(f), v = s.indexOf(f) !== -1, G = f !== null, !v && G && (f = u.current[f].parentId));
|
|
190
|
+
const W = y ? l : f, ye = Z(W), ft = s[s.indexOf(W) - 1], pt = c[c.indexOf(W) - 1];
|
|
191
|
+
return ye.indexOf(ft) < ye.indexOf(pt) ? [e, t] : [t, e];
|
|
192
|
+
}, Be = (e, t) => {
|
|
193
|
+
const [r, n] = ze(e, t), s = [r];
|
|
194
|
+
let c = r;
|
|
195
|
+
for (; c !== n; )
|
|
196
|
+
c = ee(c), s.push(c);
|
|
197
|
+
return s;
|
|
198
|
+
}, F = (e, t) => {
|
|
199
|
+
t && (ne(t), fe && fe(e, t));
|
|
200
|
+
}, be = (e, t) => F(e, ee(t)), Ue = (e, t) => F(e, se(t)), ve = (e) => F(e, ae()), Ge = (e) => F(e, oe()), We = (e, t, r) => {
|
|
201
|
+
let n, s;
|
|
202
|
+
const c = r.toLowerCase(), l = [], f = [];
|
|
203
|
+
Object.keys(B.current).forEach((y) => {
|
|
204
|
+
const v = B.current[y], q = u.current[y], G = q.parentId ? k(q.parentId) : !0, W = w ? !1 : S(y);
|
|
205
|
+
G && !W && (l.push(y), f.push(v));
|
|
206
|
+
}), n = l.indexOf(t) + 1, n >= l.length && (n = 0), s = Ie(f, n, c), s === -1 && (s = Ie(f, 0, c)), s > -1 && F(e, l[s]);
|
|
207
|
+
}, te = (e, t = a) => {
|
|
208
|
+
let r;
|
|
209
|
+
j.indexOf(t) !== -1 ? r = j.filter((n) => n !== t) : r = [t].concat(j), J && J(e, r), ge(r);
|
|
210
|
+
}, He = (e, t) => {
|
|
211
|
+
const r = u.current[t], s = Z(r.parentId).filter((l) => X(l) && !k(l)), c = j.concat(s);
|
|
212
|
+
s.length > 0 && (ge(c), J && J(e, c));
|
|
213
|
+
}, D = p.useRef(null), L = p.useRef(!1), C = p.useRef([]), Ye = (e, t) => {
|
|
214
|
+
let r = x.slice();
|
|
215
|
+
const {
|
|
216
|
+
start: n,
|
|
217
|
+
next: s,
|
|
218
|
+
current: c
|
|
219
|
+
} = t;
|
|
220
|
+
!s || !c || (C.current.indexOf(c) === -1 && (C.current = []), L.current ? C.current.indexOf(s) !== -1 ? (r = r.filter((l) => l === n || l !== c), C.current = C.current.filter((l) => l === n || l !== c)) : (r.push(s), C.current.push(s)) : (r.push(s), C.current.push(c, s)), P && P(e, r), Q(r));
|
|
221
|
+
}, Je = (e, t) => {
|
|
222
|
+
let r = x.slice();
|
|
223
|
+
const {
|
|
224
|
+
start: n,
|
|
225
|
+
end: s
|
|
226
|
+
} = t;
|
|
227
|
+
L.current && (r = r.filter((f) => C.current.indexOf(f) === -1));
|
|
228
|
+
let c = Be(n, s);
|
|
229
|
+
c = c.filter((f) => !S(f)), C.current = c;
|
|
230
|
+
let l = r.concat(c);
|
|
231
|
+
l = l.filter((f, y) => l.indexOf(f) === y), P && P(e, l), Q(l);
|
|
232
|
+
}, Qe = (e, t) => {
|
|
233
|
+
let r;
|
|
234
|
+
x.indexOf(t) !== -1 ? r = x.filter((n) => n !== t) : r = [t].concat(x), P && P(e, r), Q(r);
|
|
235
|
+
}, Xe = (e, t) => {
|
|
236
|
+
const r = h ? [t] : t;
|
|
237
|
+
P && P(e, r), Q(r);
|
|
238
|
+
}, U = (e, t, r = !1) => t ? (r ? Qe(e, t) : Xe(e, t), D.current = t, L.current = !1, C.current = [], !0) : !1, V = (e, t, r = !1) => {
|
|
239
|
+
const {
|
|
240
|
+
start: n = D.current,
|
|
241
|
+
end: s,
|
|
242
|
+
current: c
|
|
243
|
+
} = t;
|
|
244
|
+
r ? Ye(e, {
|
|
245
|
+
start: n,
|
|
246
|
+
next: s,
|
|
247
|
+
current: c
|
|
248
|
+
}) : n != null && s != null && Je(e, {
|
|
249
|
+
start: n,
|
|
250
|
+
end: s
|
|
251
|
+
}), L.current = !0;
|
|
252
|
+
}, Ze = (e, t) => {
|
|
253
|
+
D.current || (D.current = t);
|
|
254
|
+
const r = L.current ? D.current : t;
|
|
255
|
+
V(e, {
|
|
256
|
+
start: r,
|
|
257
|
+
end: ae()
|
|
258
|
+
});
|
|
259
|
+
}, et = (e, t) => {
|
|
260
|
+
D.current || (D.current = t);
|
|
261
|
+
const r = L.current ? D.current : t;
|
|
262
|
+
V(e, {
|
|
263
|
+
start: r,
|
|
264
|
+
end: oe()
|
|
265
|
+
});
|
|
266
|
+
}, tt = (e, t) => {
|
|
267
|
+
S(ee(t)) || V(e, {
|
|
268
|
+
end: ee(t),
|
|
269
|
+
current: t
|
|
270
|
+
}, !0);
|
|
271
|
+
}, rt = (e, t) => {
|
|
272
|
+
S(se(t)) || V(e, {
|
|
273
|
+
end: se(t),
|
|
274
|
+
current: t
|
|
275
|
+
}, !0);
|
|
276
|
+
}, nt = (e) => {
|
|
277
|
+
V(e, {
|
|
278
|
+
start: ae(),
|
|
279
|
+
end: oe()
|
|
280
|
+
});
|
|
281
|
+
}, st = p.useCallback((e) => {
|
|
282
|
+
const {
|
|
283
|
+
id: t,
|
|
284
|
+
index: r,
|
|
285
|
+
parentId: n,
|
|
286
|
+
expandable: s,
|
|
287
|
+
idAttribute: c,
|
|
288
|
+
disabled: l
|
|
289
|
+
} = e;
|
|
290
|
+
u.current[t] = {
|
|
291
|
+
id: t,
|
|
292
|
+
index: r,
|
|
293
|
+
parentId: n,
|
|
294
|
+
expandable: s,
|
|
295
|
+
idAttribute: c,
|
|
296
|
+
disabled: l
|
|
297
|
+
};
|
|
298
|
+
}, []), ot = p.useCallback((e) => {
|
|
299
|
+
const t = {
|
|
300
|
+
...u.current
|
|
301
|
+
};
|
|
302
|
+
delete t[e], u.current = t, ne((r) => r === e && re.current === Pe(re.current).activeElement ? Z(null)[0] : r);
|
|
303
|
+
}, []), at = p.useCallback((e, t) => {
|
|
304
|
+
B.current[e] = t;
|
|
305
|
+
}, []), ct = p.useCallback((e) => {
|
|
306
|
+
const t = {
|
|
307
|
+
...B.current
|
|
308
|
+
};
|
|
309
|
+
delete t[e], B.current = t;
|
|
310
|
+
}, []), xe = (e) => (X(a) && (k(a) ? be(e, a) : S(a) || te(e)), !0), Se = (e) => {
|
|
311
|
+
if (k(a) && !S(a))
|
|
312
|
+
return te(e, a), !0;
|
|
313
|
+
const t = qe(a);
|
|
314
|
+
return t ? (F(e, t), !0) : !1;
|
|
315
|
+
}, lt = (e) => {
|
|
316
|
+
let t = !1;
|
|
317
|
+
const r = e.key;
|
|
318
|
+
if (e.altKey || e.currentTarget !== e.target || !a)
|
|
319
|
+
return;
|
|
320
|
+
const n = e.ctrlKey || e.metaKey;
|
|
321
|
+
switch (r) {
|
|
322
|
+
case " ":
|
|
323
|
+
!m && !S(a) && (h && e.shiftKey ? (V(e, {
|
|
324
|
+
end: a
|
|
325
|
+
}), t = !0) : h ? t = U(e, a, !0) : t = U(e, a)), e.stopPropagation();
|
|
326
|
+
break;
|
|
327
|
+
case "Enter":
|
|
328
|
+
S(a) || (X(a) ? (te(e), t = !0) : h ? t = U(e, a, !0) : t = U(e, a)), e.stopPropagation();
|
|
329
|
+
break;
|
|
330
|
+
case "ArrowDown":
|
|
331
|
+
h && e.shiftKey && !m && tt(e, a), be(e, a), t = !0;
|
|
332
|
+
break;
|
|
333
|
+
case "ArrowUp":
|
|
334
|
+
h && e.shiftKey && !m && rt(e, a), Ue(e, a), t = !0;
|
|
335
|
+
break;
|
|
336
|
+
case "ArrowRight":
|
|
337
|
+
pe ? t = Se(e) : t = xe(e);
|
|
338
|
+
break;
|
|
339
|
+
case "ArrowLeft":
|
|
340
|
+
pe ? t = xe(e) : t = Se(e);
|
|
341
|
+
break;
|
|
342
|
+
case "Home":
|
|
343
|
+
h && n && e.shiftKey && !m && !S(a) && Ze(e, a), ve(e), t = !0;
|
|
344
|
+
break;
|
|
345
|
+
case "End":
|
|
346
|
+
h && n && e.shiftKey && !m && !S(a) && et(e, a), Ge(e), t = !0;
|
|
347
|
+
break;
|
|
348
|
+
default:
|
|
349
|
+
r === "*" ? (He(e, a), t = !0) : h && n && r.toLowerCase() === "a" && !m ? (nt(e), t = !0) : !n && !e.shiftKey && Jt(r) && (We(e, a, r), t = !0);
|
|
350
|
+
}
|
|
351
|
+
t && (e.preventDefault(), e.stopPropagation()), Y && Y(e);
|
|
352
|
+
}, it = (e) => {
|
|
353
|
+
if (e.target === e.currentTarget) {
|
|
354
|
+
const t = Array.isArray(x) ? x[0] : x;
|
|
355
|
+
F(e, t || I(null)[0]);
|
|
356
|
+
}
|
|
357
|
+
H && H(e);
|
|
358
|
+
}, ut = (e) => {
|
|
359
|
+
ne(null), K && K(e);
|
|
360
|
+
}, dt = u.current[a] ? u.current[a].idAttribute : null;
|
|
361
|
+
return /* @__PURE__ */ _(Dt.Provider, {
|
|
362
|
+
// TODO: fix this lint error
|
|
363
|
+
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
364
|
+
value: {
|
|
365
|
+
icons: {
|
|
366
|
+
defaultCollapseIcon: E,
|
|
367
|
+
defaultExpandIcon: $,
|
|
368
|
+
defaultParentIcon: z,
|
|
369
|
+
defaultEndIcon: M
|
|
370
|
+
},
|
|
371
|
+
focus: F,
|
|
372
|
+
toggleExpansion: te,
|
|
373
|
+
isExpanded: k,
|
|
374
|
+
isExpandable: X,
|
|
375
|
+
isFocused: Le,
|
|
376
|
+
isSelected: Ke,
|
|
377
|
+
isDisabled: S,
|
|
378
|
+
selectNode: m ? Ce : U,
|
|
379
|
+
selectRange: m ? Ce : V,
|
|
380
|
+
multiSelect: h,
|
|
381
|
+
disabledItemsFocusable: w,
|
|
382
|
+
mapFirstChar: at,
|
|
383
|
+
unMapFirstChar: ct,
|
|
384
|
+
registerNode: st,
|
|
385
|
+
unregisterNode: ot,
|
|
386
|
+
treeId: he
|
|
387
|
+
},
|
|
388
|
+
children: /* @__PURE__ */ _(Mt, {
|
|
389
|
+
children: /* @__PURE__ */ _(Yt, {
|
|
390
|
+
role: "tree",
|
|
391
|
+
id: he,
|
|
392
|
+
"aria-activedescendant": dt,
|
|
393
|
+
"aria-multiselectable": h,
|
|
394
|
+
className: At(Ve.root, O),
|
|
395
|
+
ref: $e,
|
|
396
|
+
tabIndex: 0,
|
|
397
|
+
onKeyDown: lt,
|
|
398
|
+
onFocus: it,
|
|
399
|
+
onBlur: ut,
|
|
400
|
+
ownerState: me,
|
|
401
|
+
...je,
|
|
402
|
+
children: T
|
|
403
|
+
})
|
|
404
|
+
})
|
|
405
|
+
});
|
|
406
|
+
});
|
|
407
|
+
process.env.NODE_ENV !== "production" && (ke.propTypes = {
|
|
408
|
+
// ----------------------------- Warning --------------------------------
|
|
409
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
410
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
411
|
+
// ----------------------------------------------------------------------
|
|
412
|
+
/**
|
|
413
|
+
* The content of the component.
|
|
414
|
+
*/
|
|
415
|
+
children: o.node,
|
|
416
|
+
/**
|
|
417
|
+
* Override or extend the styles applied to the component.
|
|
418
|
+
*/
|
|
419
|
+
classes: o.object,
|
|
420
|
+
/**
|
|
421
|
+
* @ignore
|
|
422
|
+
*/
|
|
423
|
+
className: o.string,
|
|
424
|
+
/**
|
|
425
|
+
* The default icon used to collapse the node.
|
|
426
|
+
*/
|
|
427
|
+
defaultCollapseIcon: o.node,
|
|
428
|
+
/**
|
|
429
|
+
* The default icon displayed next to a end node. This is applied to all
|
|
430
|
+
* tree nodes and can be overridden by the TreeItem `icon` prop.
|
|
431
|
+
*/
|
|
432
|
+
defaultEndIcon: o.node,
|
|
433
|
+
/**
|
|
434
|
+
* Expanded node ids. (Uncontrolled)
|
|
435
|
+
* @default []
|
|
436
|
+
*/
|
|
437
|
+
defaultExpanded: o.arrayOf(o.string),
|
|
438
|
+
/**
|
|
439
|
+
* The default icon used to expand the node.
|
|
440
|
+
*/
|
|
441
|
+
defaultExpandIcon: o.node,
|
|
442
|
+
/**
|
|
443
|
+
* The default icon displayed next to a parent node. This is applied to all
|
|
444
|
+
* parent nodes and can be overridden by the TreeItem `icon` prop.
|
|
445
|
+
*/
|
|
446
|
+
defaultParentIcon: o.node,
|
|
447
|
+
/**
|
|
448
|
+
* Selected node ids. (Uncontrolled)
|
|
449
|
+
* When `multiSelect` is true this takes an array of strings; when false (default) a string.
|
|
450
|
+
* @default []
|
|
451
|
+
*/
|
|
452
|
+
defaultSelected: o.oneOfType([o.arrayOf(o.string), o.string]),
|
|
453
|
+
/**
|
|
454
|
+
* If `true`, will allow focus on disabled items.
|
|
455
|
+
* @default false
|
|
456
|
+
*/
|
|
457
|
+
disabledItemsFocusable: o.bool,
|
|
458
|
+
/**
|
|
459
|
+
* If `true` selection is disabled.
|
|
460
|
+
* @default false
|
|
461
|
+
*/
|
|
462
|
+
disableSelection: o.bool,
|
|
463
|
+
/**
|
|
464
|
+
* Expanded node ids. (Controlled)
|
|
465
|
+
*/
|
|
466
|
+
expanded: o.arrayOf(o.string),
|
|
467
|
+
/**
|
|
468
|
+
* This prop is used to help implement the accessibility logic.
|
|
469
|
+
* If you don't provide this prop. It falls back to a randomly generated id.
|
|
470
|
+
*/
|
|
471
|
+
id: o.string,
|
|
472
|
+
/**
|
|
473
|
+
* If true `ctrl` and `shift` will trigger multiselect.
|
|
474
|
+
* @default false
|
|
475
|
+
*/
|
|
476
|
+
multiSelect: o.bool,
|
|
477
|
+
/**
|
|
478
|
+
* @ignore
|
|
479
|
+
*/
|
|
480
|
+
onBlur: o.func,
|
|
481
|
+
/**
|
|
482
|
+
* @ignore
|
|
483
|
+
*/
|
|
484
|
+
onFocus: o.func,
|
|
485
|
+
/**
|
|
486
|
+
* @ignore
|
|
487
|
+
*/
|
|
488
|
+
onKeyDown: o.func,
|
|
489
|
+
/**
|
|
490
|
+
* Callback fired when tree items are focused.
|
|
491
|
+
*
|
|
492
|
+
* @param {React.SyntheticEvent} event The event source of the callback **Warning**: This is a generic event not a focus event.
|
|
493
|
+
* @param {string} value of the focused node.
|
|
494
|
+
*/
|
|
495
|
+
onNodeFocus: o.func,
|
|
496
|
+
/**
|
|
497
|
+
* Callback fired when tree items are selected/unselected.
|
|
498
|
+
*
|
|
499
|
+
* @param {React.SyntheticEvent} event The event source of the callback
|
|
500
|
+
* @param {string[] | string} nodeIds Ids of the selected nodes. When `multiSelect` is true
|
|
501
|
+
* this is an array of strings; when false (default) a string.
|
|
502
|
+
*/
|
|
503
|
+
onNodeSelect: o.func,
|
|
504
|
+
/**
|
|
505
|
+
* Callback fired when tree items are expanded/collapsed.
|
|
506
|
+
*
|
|
507
|
+
* @param {React.SyntheticEvent} event The event source of the callback.
|
|
508
|
+
* @param {array} nodeIds The ids of the expanded nodes.
|
|
509
|
+
*/
|
|
510
|
+
onNodeToggle: o.func,
|
|
511
|
+
/**
|
|
512
|
+
* Selected node ids. (Controlled)
|
|
513
|
+
* When `multiSelect` is true this takes an array of strings; when false (default) a string.
|
|
514
|
+
*/
|
|
515
|
+
selected: o.oneOfType([o.arrayOf(o.string), o.string]),
|
|
516
|
+
/**
|
|
517
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
518
|
+
*/
|
|
519
|
+
sx: o.oneOfType([o.arrayOf(o.oneOfType([o.func, o.object, o.bool])), o.func, o.object])
|
|
520
|
+
});
|
|
521
|
+
var ie = {}, ce = {};
|
|
522
|
+
const Zt = /* @__PURE__ */ yt(Gt);
|
|
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", {
|
|
540
|
+
value: !0
|
|
541
|
+
});
|
|
542
|
+
var De = ie.default = void 0, tr = er(Fe()), rr = Oe;
|
|
543
|
+
De = ie.default = (0, tr.default)(/* @__PURE__ */ (0, rr.jsx)("path", {
|
|
544
|
+
d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
|
|
545
|
+
}), "ExpandMore");
|
|
546
|
+
var ue = {}, nr = Ee;
|
|
547
|
+
Object.defineProperty(ue, "__esModule", {
|
|
548
|
+
value: !0
|
|
549
|
+
});
|
|
550
|
+
var Me = ue.default = void 0, sr = nr(Fe()), or = Oe;
|
|
551
|
+
Me = ue.default = (0, sr.default)(/* @__PURE__ */ (0, or.jsx)("path", {
|
|
552
|
+
d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
|
|
553
|
+
}), "ChevronRight");
|
|
554
|
+
const Or = ({
|
|
555
|
+
data: i,
|
|
556
|
+
idKey: d = "id",
|
|
557
|
+
selected: b,
|
|
558
|
+
expanded: g,
|
|
559
|
+
disabled: T,
|
|
560
|
+
disableSearch: O,
|
|
561
|
+
onChange: E,
|
|
562
|
+
onToggle: M
|
|
563
|
+
}) => {
|
|
564
|
+
const [N, $] = we.useState(""), z = Kt(i), A = we.useMemo(() => N.length > 0 ? z.filter(
|
|
565
|
+
(R) => R.name.toLowerCase().includes(N)
|
|
566
|
+
) : i, [N, i]);
|
|
567
|
+
let w = null;
|
|
568
|
+
const m = 500;
|
|
569
|
+
return /* @__PURE__ */ mt(ht, { children: [
|
|
570
|
+
!O && /* @__PURE__ */ _(Vt, { px: 1, children: /* @__PURE__ */ _(
|
|
571
|
+
$t,
|
|
572
|
+
{
|
|
573
|
+
fullWidth: !0,
|
|
574
|
+
disableLabel: !0,
|
|
575
|
+
placeholder: "Search",
|
|
576
|
+
sx: {
|
|
577
|
+
"& .MuiInputBase-input": {
|
|
578
|
+
p: "8px 0px 8px 12px",
|
|
579
|
+
fontSize: "small"
|
|
580
|
+
}
|
|
581
|
+
},
|
|
582
|
+
iconSize: "small",
|
|
583
|
+
onChange: (R) => {
|
|
584
|
+
w && clearTimeout(w), w = setTimeout(() => $(R.toLowerCase()), m);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
) }),
|
|
588
|
+
/* @__PURE__ */ _(
|
|
589
|
+
ke,
|
|
590
|
+
{
|
|
591
|
+
"aria-label": "tree view filter",
|
|
592
|
+
defaultCollapseIcon: /* @__PURE__ */ _(De, {}),
|
|
593
|
+
defaultExpandIcon: /* @__PURE__ */ _(Me, {}),
|
|
594
|
+
disableSelection: !0,
|
|
595
|
+
expanded: g,
|
|
596
|
+
onNodeToggle: M,
|
|
597
|
+
children: A.map((R, h) => {
|
|
598
|
+
const K = String(R[d]), H = Ne.includes(b, K), Y = Ne.includes(T, K);
|
|
599
|
+
return /* @__PURE__ */ _(
|
|
600
|
+
jt,
|
|
601
|
+
{
|
|
602
|
+
id: K,
|
|
603
|
+
idKey: d,
|
|
604
|
+
name: R.name,
|
|
605
|
+
checked: H,
|
|
606
|
+
disabled: Y,
|
|
607
|
+
disabledIds: T,
|
|
608
|
+
children: R.children,
|
|
609
|
+
onChange: E,
|
|
610
|
+
defaultSelected: b
|
|
611
|
+
},
|
|
612
|
+
h
|
|
613
|
+
);
|
|
614
|
+
})
|
|
615
|
+
}
|
|
616
|
+
)
|
|
617
|
+
] });
|
|
618
|
+
};
|
|
619
|
+
export {
|
|
620
|
+
Or as TreeViewFilter
|
|
621
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsxs as c, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { RadioButtonUnchecked as l, CheckCircle as s } from "@mui/icons-material";
|
|
3
|
+
import { B as p, C as h } from "../../../Checkbox-DostZSwR.js";
|
|
4
|
+
import { T as d } from "../../../Typography-XIiVCSto.js";
|
|
5
|
+
function k({
|
|
6
|
+
id: t,
|
|
7
|
+
name: n,
|
|
8
|
+
checked: i,
|
|
9
|
+
disabled: r,
|
|
10
|
+
onChange: o
|
|
11
|
+
}) {
|
|
12
|
+
return /* @__PURE__ */ c(p, { display: "flex", alignItems: "center", py: 1, children: [
|
|
13
|
+
/* @__PURE__ */ a(
|
|
14
|
+
h,
|
|
15
|
+
{
|
|
16
|
+
size: "small",
|
|
17
|
+
checked: i,
|
|
18
|
+
value: t,
|
|
19
|
+
sx: { padding: 0, marginRight: 0.85 },
|
|
20
|
+
icon: /* @__PURE__ */ a(l, {}),
|
|
21
|
+
checkedIcon: /* @__PURE__ */ a(s, {}),
|
|
22
|
+
disabled: r,
|
|
23
|
+
onChange: (e) => {
|
|
24
|
+
o && o(e.target.value, e.target.checked);
|
|
25
|
+
},
|
|
26
|
+
onClick: (e) => {
|
|
27
|
+
e.stopPropagation();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
/* @__PURE__ */ a(
|
|
32
|
+
d,
|
|
33
|
+
{
|
|
34
|
+
variant: "subtitle1",
|
|
35
|
+
fontSize: "14px",
|
|
36
|
+
sx: { userSelect: "none" },
|
|
37
|
+
children: n
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
] });
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
k as default
|
|
44
|
+
};
|