@para-ui/core 5.0.1 → 5.0.3-beta.8
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/FieldForm/component.json +22 -1
- package/FormItemGroup/component.json +72 -0
- package/Menu/component.json +9 -2
- package/es/Checkbox/index.js +26 -24
- package/es/CheckboxGroup/index.css +1 -1
- package/es/CheckboxGroup/style/index.css +1 -1
- package/es/ExpressionInput/Popup.js +11 -4
- package/es/ExpressionInput/useExpressionInput.js +40 -37
- package/es/FieldForm/ErrorList.js +9 -8
- package/es/FieldForm/FieldFormItem/ItemHolder.d.ts +2 -0
- package/es/FieldForm/FieldFormItem/ItemHolder.js +78 -68
- package/es/FieldForm/FieldFormItem/index.d.ts +3 -0
- package/es/FieldForm/FieldFormItem/index.js +131 -120
- package/es/FieldForm/Form.d.ts +3 -1
- package/es/FieldForm/Form.js +54 -50
- package/es/FieldForm/compactControlMarker.d.ts +18 -0
- package/es/FieldForm/compactControlMarker.js +5 -0
- package/es/FieldForm/component.json +22 -1
- package/es/FieldForm/context.d.ts +3 -1
- package/es/FieldForm/context.js +6 -5
- package/es/FieldForm/index.css +1 -1
- package/es/FieldForm/index.d.ts +2 -0
- package/es/FieldForm/index.js +13 -9
- package/es/FieldForm/interface.d.ts +9 -0
- package/es/FieldForm/style/index.css +1 -1
- package/es/FieldForm/util.d.ts +14 -0
- package/es/FieldForm/util.js +41 -17
- package/es/FormItemGroup/component.json +72 -0
- package/es/FormItemGroup/index.css +1 -0
- package/es/FormItemGroup/index.d.ts +14 -0
- package/es/FormItemGroup/index.js +27 -0
- package/es/FormItemGroup/style/css.js +1 -0
- package/es/FormItemGroup/style/index.css +1 -0
- package/es/FormItemGroup/style/index.js +1 -0
- package/es/HelperText/index.js +15 -13
- package/es/Menu/component.json +9 -2
- package/es/Menu/index.css +1 -1
- package/es/Menu/interface.d.ts +2 -0
- package/es/Menu/style/index.css +1 -1
- package/es/Menu/verticalMenuList.js +378 -361
- package/es/RadioGroup/index.css +1 -1
- package/es/RadioGroup/style/index.css +1 -1
- package/es/RangeInput/index.js +60 -60
- package/es/Switch/index.js +30 -28
- package/es/Tag/TagGroup.js +29 -32
- package/es/Tag/index.js +5 -5
- package/es/index.d.ts +2 -0
- package/es/index.js +175 -169
- package/lib/Checkbox/index.js +1 -1
- package/lib/CheckboxGroup/index.css +1 -1
- package/lib/CheckboxGroup/style/index.css +1 -1
- package/lib/ExpressionInput/Popup.js +1 -1
- package/lib/ExpressionInput/useExpressionInput.js +1 -1
- package/lib/FieldForm/ErrorList.js +1 -1
- package/lib/FieldForm/FieldFormItem/ItemHolder.d.ts +2 -0
- package/lib/FieldForm/FieldFormItem/ItemHolder.js +1 -1
- package/lib/FieldForm/FieldFormItem/index.d.ts +3 -0
- package/lib/FieldForm/FieldFormItem/index.js +1 -1
- package/lib/FieldForm/Form.d.ts +3 -1
- package/lib/FieldForm/Form.js +1 -1
- package/lib/FieldForm/compactControlMarker.d.ts +18 -0
- package/lib/FieldForm/compactControlMarker.js +2 -0
- package/lib/FieldForm/component.json +22 -1
- package/lib/FieldForm/context.d.ts +3 -1
- package/lib/FieldForm/context.js +1 -1
- package/lib/FieldForm/index.css +1 -1
- package/lib/FieldForm/index.d.ts +2 -0
- package/lib/FieldForm/index.js +1 -1
- package/lib/FieldForm/interface.d.ts +9 -0
- package/lib/FieldForm/style/index.css +1 -1
- package/lib/FieldForm/util.d.ts +14 -0
- package/lib/FieldForm/util.js +1 -1
- package/lib/FormItemGroup/component.json +72 -0
- package/lib/FormItemGroup/index.css +1 -0
- package/lib/FormItemGroup/index.d.ts +14 -0
- package/lib/FormItemGroup/index.js +2 -0
- package/lib/FormItemGroup/style/css.js +1 -0
- package/lib/FormItemGroup/style/index.css +1 -0
- package/lib/FormItemGroup/style/index.js +1 -0
- package/lib/HelperText/index.js +1 -1
- package/lib/Menu/component.json +9 -2
- package/lib/Menu/index.css +1 -1
- package/lib/Menu/interface.d.ts +2 -0
- package/lib/Menu/style/index.css +1 -1
- package/lib/Menu/verticalMenuList.js +1 -1
- package/lib/RadioGroup/index.css +1 -1
- package/lib/RadioGroup/style/index.css +1 -1
- package/lib/RangeInput/index.js +1 -1
- package/lib/Switch/index.js +1 -1
- package/lib/Tag/TagGroup.js +1 -1
- package/lib/Tag/index.js +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -1
- package/package.json +14 -1
|
@@ -1,238 +1,255 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import Te, { useState as
|
|
1
|
+
import { j as e } from "../_virtual/jsx-runtime.js";
|
|
2
|
+
import Te, { useState as C, useEffect as A, useMemo as D, createElement as Ne, useRef as ke } from "react";
|
|
3
3
|
import { createPortal as Le } from "react-dom";
|
|
4
4
|
import be from "../CollapseBox/index.js";
|
|
5
|
-
import { Down as
|
|
6
|
-
import * as
|
|
5
|
+
import { Down as G } from "../para-ui-core/node_modules/@para-ui/icons/Down/index.js";
|
|
6
|
+
import * as pe from "../para-ui-core/node_modules/@para-ui/icons/index.js";
|
|
7
7
|
import { UUID as Ee, DeepClone as ye } from "@snack-kit/lib";
|
|
8
|
-
import { $prefixCls as
|
|
9
|
-
import
|
|
10
|
-
const
|
|
11
|
-
let
|
|
12
|
-
return (!
|
|
13
|
-
},
|
|
14
|
-
href:
|
|
15
|
-
} : {},
|
|
8
|
+
import { $prefixCls as z } from "../GlobalContext/constant.js";
|
|
9
|
+
import me from "../AutoTips/index.js";
|
|
10
|
+
const he = (h) => {
|
|
11
|
+
let c = "div";
|
|
12
|
+
return (!h || h.length === 0) && (c = "a"), c;
|
|
13
|
+
}, fe = (h = [], c, E) => !h || h.length === 0 ? {
|
|
14
|
+
href: E || `#${c}`
|
|
15
|
+
} : {}, de = (h) => {
|
|
16
16
|
const {
|
|
17
|
-
label:
|
|
18
|
-
type:
|
|
19
|
-
path:
|
|
20
|
-
href:
|
|
21
|
-
icon:
|
|
22
|
-
children:
|
|
23
|
-
className:
|
|
24
|
-
level:
|
|
25
|
-
badge:
|
|
26
|
-
selectMenu:
|
|
27
|
-
idMenuLast:
|
|
28
|
-
onClickMenu:
|
|
29
|
-
shrinkOthers:
|
|
30
|
-
jumpIcon:
|
|
31
|
-
onClickJump:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
17
|
+
label: c,
|
|
18
|
+
type: E = "router",
|
|
19
|
+
path: T,
|
|
20
|
+
href: N,
|
|
21
|
+
icon: y,
|
|
22
|
+
children: l,
|
|
23
|
+
className: O,
|
|
24
|
+
level: d = 1,
|
|
25
|
+
badge: v,
|
|
26
|
+
selectMenu: L = "",
|
|
27
|
+
idMenuLast: f,
|
|
28
|
+
onClickMenu: m,
|
|
29
|
+
shrinkOthers: g = !0,
|
|
30
|
+
jumpIcon: j,
|
|
31
|
+
onClickJump: k,
|
|
32
|
+
group: P
|
|
33
|
+
} = h, [I, _] = C(!1), Y = !!(P && d === 1 && l && l.length > 0);
|
|
34
|
+
A(() => {
|
|
35
|
+
const o = f?.[L || ""];
|
|
36
|
+
o && o.indexOf(T || "") !== -1 && o.length > 1 ? _(!0) : g && _(!1);
|
|
37
|
+
}, [f, L, T]);
|
|
38
|
+
const w = (o) => {
|
|
39
|
+
if (l && l.length > 0)
|
|
40
|
+
return m && m(!1), _(!I);
|
|
41
|
+
m && m(h), o.preventDefault();
|
|
42
|
+
}, B = () => {
|
|
43
|
+
if (y) {
|
|
44
|
+
const o = pe[y];
|
|
45
|
+
return o ? /* @__PURE__ */ e.jsx("span", { className: "menu-item-icon", children: o() }) : /* @__PURE__ */ e.jsx("span", { className: "menu-item-icon", children: y });
|
|
45
46
|
}
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
},
|
|
47
|
+
}, F = (o) => {
|
|
48
|
+
o.stopPropagation(), o.preventDefault(), k?.(h);
|
|
49
|
+
}, S = () => l && l.length > 0 ? /* @__PURE__ */ e.jsx(G, {}) : j ? /* @__PURE__ */ e.jsx(
|
|
49
50
|
"span",
|
|
50
51
|
{
|
|
51
52
|
className: "jump-icon",
|
|
52
|
-
onClick:
|
|
53
|
-
children:
|
|
53
|
+
onClick: F,
|
|
54
|
+
children: j
|
|
54
55
|
}
|
|
55
|
-
) : /* @__PURE__ */
|
|
56
|
-
if (
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
},
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
63
|
-
const
|
|
64
|
-
|
|
56
|
+
) : /* @__PURE__ */ e.jsx(G, { className: "opacity-pos-svg" }), U = () => {
|
|
57
|
+
if (v !== void 0)
|
|
58
|
+
return /* @__PURE__ */ e.jsx("div", { className: "menu-item-badge", children: /* @__PURE__ */ e.jsx("span", { children: v }) });
|
|
59
|
+
}, p = () => {
|
|
60
|
+
let o = "vertical-menu-list-item";
|
|
61
|
+
I && (o += " vertical-menu-list-item-open"), O && (o += ` ${O}`);
|
|
62
|
+
const M = f?.[L || ""];
|
|
63
|
+
if (M) {
|
|
64
|
+
const H = M.indexOf(T || "");
|
|
65
|
+
H !== -1 && (o += " vertical-menu-list-item-select", H === M.length - 1 && (o += " vertical-menu-list-item-select-last"), I || (o += " vertical-menu-list-item-select-retract"));
|
|
65
66
|
}
|
|
66
|
-
return
|
|
67
|
-
},
|
|
68
|
-
const
|
|
67
|
+
return o;
|
|
68
|
+
}, $ = () => {
|
|
69
|
+
const o = {
|
|
69
70
|
paddingRight: "12px",
|
|
70
71
|
paddingLeft: "0px"
|
|
71
|
-
},
|
|
72
|
-
return
|
|
73
|
-
},
|
|
74
|
-
const
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
-
|
|
72
|
+
}, M = typeof d == "number" ? d : 1;
|
|
73
|
+
return M >= 0 && (o.paddingLeft = `${(M - 1) * 26 + 12}px`), o;
|
|
74
|
+
}, x = D(() => {
|
|
75
|
+
const o = he(l);
|
|
76
|
+
return /* @__PURE__ */ e.jsxs(
|
|
77
|
+
o,
|
|
77
78
|
{
|
|
78
|
-
onClick:
|
|
79
|
+
onClick: w,
|
|
79
80
|
className: "vertical-menu-list-item-content",
|
|
80
|
-
style:
|
|
81
|
-
...
|
|
81
|
+
style: $(),
|
|
82
|
+
...fe(l, T, N),
|
|
82
83
|
children: [
|
|
83
|
-
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
/* @__PURE__ */
|
|
86
|
-
|
|
84
|
+
B(),
|
|
85
|
+
/* @__PURE__ */ e.jsxs("div", { className: "menu-item-content", children: [
|
|
86
|
+
/* @__PURE__ */ e.jsx("span", { className: "menu-item-label", children: /* @__PURE__ */ e.jsx(me, { children: c }) }),
|
|
87
|
+
U()
|
|
87
88
|
] }),
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ e.jsx("span", { className: "menu-item-arrow", children: S() })
|
|
89
90
|
]
|
|
90
91
|
}
|
|
91
92
|
);
|
|
92
|
-
}, [
|
|
93
|
+
}, [l, m, I, d, y, c, T, N, j]), a = D(() => /* @__PURE__ */ e.jsx(
|
|
93
94
|
be,
|
|
94
95
|
{
|
|
95
|
-
in:
|
|
96
|
+
in: I,
|
|
96
97
|
className: "li-collapse",
|
|
97
98
|
timeout: "auto",
|
|
98
99
|
unmountOnExit: !0,
|
|
99
|
-
children:
|
|
100
|
-
|
|
100
|
+
children: l && l.length > 0 && l.map((o, M) => /* @__PURE__ */ e.jsx(
|
|
101
|
+
de,
|
|
101
102
|
{
|
|
102
|
-
...
|
|
103
|
-
jumpIcon:
|
|
104
|
-
onClickJump:
|
|
105
|
-
level:
|
|
106
|
-
idMenuLast:
|
|
107
|
-
selectMenu:
|
|
108
|
-
onClickMenu:
|
|
109
|
-
shrinkOthers:
|
|
103
|
+
...o,
|
|
104
|
+
jumpIcon: j || o.jumpIcon,
|
|
105
|
+
onClickJump: k,
|
|
106
|
+
level: d + 1,
|
|
107
|
+
idMenuLast: f,
|
|
108
|
+
selectMenu: L,
|
|
109
|
+
onClickMenu: m,
|
|
110
|
+
shrinkOthers: g
|
|
110
111
|
},
|
|
111
|
-
|
|
112
|
+
M
|
|
112
113
|
))
|
|
113
114
|
}
|
|
114
|
-
), [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
), [I, l, d, f, L, m, g, j]), R = D(() => /* @__PURE__ */ e.jsxs("div", { className: "vertical-menu-list-group", children: [
|
|
116
|
+
/* @__PURE__ */ e.jsx("div", { className: "vertical-menu-list-group-label", children: /* @__PURE__ */ e.jsx(me, { children: c }) }),
|
|
117
|
+
l?.map((o, M) => /* @__PURE__ */ e.jsx(
|
|
118
|
+
de,
|
|
119
|
+
{
|
|
120
|
+
...o,
|
|
121
|
+
jumpIcon: j || o.jumpIcon,
|
|
122
|
+
onClickJump: k,
|
|
123
|
+
level: 1,
|
|
124
|
+
idMenuLast: f,
|
|
125
|
+
selectMenu: L,
|
|
126
|
+
onClickMenu: m,
|
|
127
|
+
shrinkOthers: g
|
|
128
|
+
},
|
|
129
|
+
M
|
|
130
|
+
))
|
|
131
|
+
] }), [l, j, k, f, L, m, g, c]);
|
|
132
|
+
return Y ? R : /* @__PURE__ */ e.jsxs("div", { className: p(), children: [
|
|
133
|
+
x,
|
|
134
|
+
a
|
|
118
135
|
] });
|
|
119
|
-
}, ge = (
|
|
136
|
+
}, ge = (h) => {
|
|
120
137
|
const {
|
|
121
|
-
size:
|
|
122
|
-
open:
|
|
123
|
-
anchorEl:
|
|
124
|
-
idMenuLast:
|
|
125
|
-
selectMenu:
|
|
126
|
-
onClickMenu:
|
|
127
|
-
list:
|
|
128
|
-
onMouseEnter:
|
|
129
|
-
onMouseLeave:
|
|
130
|
-
onMouseEnterBus:
|
|
131
|
-
onMouseLeaveBus:
|
|
132
|
-
level:
|
|
133
|
-
color:
|
|
134
|
-
className:
|
|
135
|
-
jumpIcon:
|
|
136
|
-
onClickJump:
|
|
137
|
-
} =
|
|
138
|
-
|
|
139
|
-
clearTimeout(
|
|
140
|
-
}, []),
|
|
141
|
-
|
|
142
|
-
}, [
|
|
143
|
-
const
|
|
144
|
-
clearTimeout(
|
|
145
|
-
if (
|
|
146
|
-
const t = document.querySelector(`[data-menu-id=${
|
|
138
|
+
size: c = "large",
|
|
139
|
+
open: E = !1,
|
|
140
|
+
anchorEl: T,
|
|
141
|
+
idMenuLast: N,
|
|
142
|
+
selectMenu: y = "",
|
|
143
|
+
onClickMenu: l,
|
|
144
|
+
list: O = [],
|
|
145
|
+
onMouseEnter: d,
|
|
146
|
+
onMouseLeave: v,
|
|
147
|
+
onMouseEnterBus: L,
|
|
148
|
+
onMouseLeaveBus: f,
|
|
149
|
+
level: m = 1,
|
|
150
|
+
color: g,
|
|
151
|
+
className: j,
|
|
152
|
+
jumpIcon: k,
|
|
153
|
+
onClickJump: P
|
|
154
|
+
} = h, [I, _] = C(!1), [Y, w] = C(""), [B, F] = C([]), [S, U] = C({}), [p] = C({}), $ = ke(null);
|
|
155
|
+
A(() => () => {
|
|
156
|
+
clearTimeout(p.leaveBox), clearTimeout(p.closeTimer), clearTimeout(p.styleTimer);
|
|
157
|
+
}, []), A(() => {
|
|
158
|
+
x();
|
|
159
|
+
}, [E, T]);
|
|
160
|
+
const x = () => {
|
|
161
|
+
clearTimeout(p.styleTimer), p.styleTimer = setTimeout(() => {
|
|
162
|
+
if (T && E && $.current) {
|
|
163
|
+
const t = document.querySelector(`[data-menu-id=${T}]`);
|
|
147
164
|
if (!t) return;
|
|
148
165
|
const i = t.getBoundingClientRect();
|
|
149
|
-
let
|
|
150
|
-
|
|
151
|
-
const
|
|
152
|
-
|
|
166
|
+
let u = i.top;
|
|
167
|
+
m !== 1 && (u = u - 4);
|
|
168
|
+
const X = document.body.clientHeight, Z = $.current.clientHeight;
|
|
169
|
+
Z + u > X && (u = u - (Z + u - X) - 20), u < 0 && (u = 0), U({
|
|
153
170
|
position: "absolute",
|
|
154
171
|
left: "0",
|
|
155
172
|
top: "0",
|
|
156
|
-
transform: `translate3d(${i.right}px, ${
|
|
173
|
+
transform: `translate3d(${i.right}px, ${u}px, 0px)`
|
|
157
174
|
});
|
|
158
175
|
}
|
|
159
176
|
});
|
|
160
|
-
},
|
|
161
|
-
let t = `${
|
|
162
|
-
return
|
|
163
|
-
},
|
|
177
|
+
}, a = () => {
|
|
178
|
+
let t = `${z}-vertical-menu-item-popper`;
|
|
179
|
+
return g && (t += ` ${z}-vertical-menu-item-popper-${g}`), c && (t += ` ${z}-vertical-menu-item-popper-${c}`), g === "deep" ? t += ` ${z}-scrollbar-small-deep` : t += ` ${z}-scrollbar-small`, k && (t += ` ${z}-vertical-menu-item-popper-jump-icon`), j && (t += ` ${j}`), t;
|
|
180
|
+
}, R = (t) => {
|
|
164
181
|
let i = "menu-item-popper-content-item";
|
|
165
|
-
const
|
|
166
|
-
return
|
|
167
|
-
},
|
|
182
|
+
const u = N?.[y || ""];
|
|
183
|
+
return u && u.indexOf(t.path || "") !== -1 && (i += " menu-item-popper-content-item-select"), i;
|
|
184
|
+
}, o = (t) => {
|
|
168
185
|
if (t) {
|
|
169
|
-
const i =
|
|
170
|
-
return i ? /* @__PURE__ */
|
|
186
|
+
const i = pe[t];
|
|
187
|
+
return i ? /* @__PURE__ */ e.jsx("span", { className: "menu-item-icon", children: i() }) : /* @__PURE__ */ e.jsx("span", { className: "menu-item-icon", children: t });
|
|
171
188
|
}
|
|
172
|
-
},
|
|
173
|
-
i.stopPropagation(), i.preventDefault(),
|
|
174
|
-
},
|
|
189
|
+
}, M = (t) => (i) => {
|
|
190
|
+
i.stopPropagation(), i.preventDefault(), P?.(t);
|
|
191
|
+
}, H = (t, i) => t && t.length > 0 ? /* @__PURE__ */ e.jsx(G, {}) : k ? /* @__PURE__ */ e.jsx(
|
|
175
192
|
"span",
|
|
176
193
|
{
|
|
177
194
|
className: "jump-icon",
|
|
178
|
-
onClick:
|
|
179
|
-
children:
|
|
195
|
+
onClick: M(i),
|
|
196
|
+
children: k
|
|
180
197
|
}
|
|
181
|
-
) : /* @__PURE__ */
|
|
198
|
+
) : /* @__PURE__ */ e.jsx(G, { className: "opacity-pos-svg" }), V = (t) => {
|
|
182
199
|
if (t.badge !== void 0)
|
|
183
|
-
return /* @__PURE__ */
|
|
200
|
+
return /* @__PURE__ */ e.jsx("div", { className: "menu-item-badge", children: /* @__PURE__ */ e.jsx("span", { children: t.badge }) });
|
|
184
201
|
}, ne = (t) => (i) => {
|
|
185
|
-
i.preventDefault(), !(t.children && t.children.length > 0) &&
|
|
202
|
+
i.preventDefault(), !(t.children && t.children.length > 0) && l && l(t);
|
|
186
203
|
}, te = () => {
|
|
187
|
-
|
|
204
|
+
m == 1 ? d && d() : L && L();
|
|
188
205
|
}, se = () => {
|
|
189
|
-
clearTimeout(
|
|
190
|
-
|
|
206
|
+
clearTimeout(p.leaveBox), p.leaveBox = setTimeout(() => {
|
|
207
|
+
m === 1 ? v && v() : f && f();
|
|
191
208
|
}, 50);
|
|
192
209
|
}, W = () => {
|
|
193
|
-
clearTimeout(
|
|
210
|
+
clearTimeout(p.leaveBox);
|
|
194
211
|
}, re = () => {
|
|
195
|
-
|
|
212
|
+
_(!1), w(""), F([]), v && v();
|
|
196
213
|
}, oe = (t) => (i) => {
|
|
197
|
-
le(i.target),
|
|
198
|
-
(t.children || []).length > 0 ? (
|
|
214
|
+
le(i.target), _(!1), clearTimeout(p.closeTimer), p.closeTimer = setTimeout(() => {
|
|
215
|
+
(t.children || []).length > 0 ? (_(!0), w(i.target.getAttribute("data-menu-id") || ""), F(t.children || [])) : (_(!1), w(""), F([]));
|
|
199
216
|
});
|
|
200
|
-
},
|
|
217
|
+
}, K = (t) => (i) => {
|
|
201
218
|
}, le = (t) => {
|
|
202
|
-
if (
|
|
203
|
-
const
|
|
204
|
-
|
|
219
|
+
if ($) {
|
|
220
|
+
const u = $.current?.querySelector(".menu-item-popper-content-item-hover");
|
|
221
|
+
u && u.classList.remove("menu-item-popper-content-item-hover");
|
|
205
222
|
}
|
|
206
223
|
t && t.classList.add("menu-item-popper-content-item-hover");
|
|
207
|
-
}, ie = D(() => /* @__PURE__ */
|
|
224
|
+
}, ie = D(() => /* @__PURE__ */ e.jsx(
|
|
208
225
|
"div",
|
|
209
226
|
{
|
|
210
227
|
className: "menu-item-popper-content",
|
|
211
228
|
onMouseEnter: te,
|
|
212
229
|
onMouseLeave: se,
|
|
213
|
-
ref:
|
|
214
|
-
children:
|
|
215
|
-
const
|
|
216
|
-
return /* @__PURE__ */
|
|
230
|
+
ref: $,
|
|
231
|
+
children: O.map((t, i) => {
|
|
232
|
+
const u = he(t.children);
|
|
233
|
+
return /* @__PURE__ */ e.jsx(
|
|
217
234
|
"div",
|
|
218
235
|
{
|
|
219
|
-
className:
|
|
236
|
+
className: R(t),
|
|
220
237
|
onMouseEnter: oe(t),
|
|
221
|
-
onMouseLeave:
|
|
222
|
-
children: /* @__PURE__ */
|
|
223
|
-
|
|
238
|
+
onMouseLeave: K(),
|
|
239
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
240
|
+
u,
|
|
224
241
|
{
|
|
225
242
|
className: "menu-item-popper-content-item-content",
|
|
226
243
|
"data-menu-id": t._paraui_menu_id,
|
|
227
244
|
onClick: ne(t),
|
|
228
|
-
...
|
|
245
|
+
...fe(t.children, t.path, t.href),
|
|
229
246
|
children: [
|
|
230
|
-
|
|
231
|
-
/* @__PURE__ */
|
|
232
|
-
/* @__PURE__ */
|
|
247
|
+
o(t.icon),
|
|
248
|
+
/* @__PURE__ */ e.jsxs("div", { className: "menu-item-content", children: [
|
|
249
|
+
/* @__PURE__ */ e.jsx("span", { className: "menu-item-label", children: /* @__PURE__ */ e.jsx(me, { children: t.label }) }),
|
|
233
250
|
V(t)
|
|
234
251
|
] }),
|
|
235
|
-
/* @__PURE__ */
|
|
252
|
+
/* @__PURE__ */ e.jsx("span", { className: "menu-item-arrow", children: H(t.children, t) })
|
|
236
253
|
]
|
|
237
254
|
}
|
|
238
255
|
)
|
|
@@ -242,272 +259,272 @@ const de = (d) => {
|
|
|
242
259
|
})
|
|
243
260
|
}
|
|
244
261
|
), [
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
]), ce = () => /* @__PURE__ */
|
|
262
|
+
O,
|
|
263
|
+
l,
|
|
264
|
+
N,
|
|
265
|
+
y,
|
|
266
|
+
l,
|
|
267
|
+
d,
|
|
268
|
+
v,
|
|
269
|
+
m,
|
|
270
|
+
P,
|
|
271
|
+
k
|
|
272
|
+
]), ce = () => /* @__PURE__ */ e.jsx(
|
|
256
273
|
"div",
|
|
257
274
|
{
|
|
258
|
-
className:
|
|
259
|
-
style:
|
|
275
|
+
className: a(),
|
|
276
|
+
style: S,
|
|
260
277
|
children: ie
|
|
261
278
|
}
|
|
262
|
-
),
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
279
|
+
), Q = D(() => /* @__PURE__ */ e.jsx(e.Fragment, { children: Le(/* @__PURE__ */ e.jsx(ce, {}), document.getElementsByTagName("body")[0]) }), [
|
|
280
|
+
S,
|
|
281
|
+
O,
|
|
282
|
+
l,
|
|
283
|
+
N,
|
|
284
|
+
y,
|
|
285
|
+
l,
|
|
286
|
+
d,
|
|
287
|
+
v,
|
|
288
|
+
m,
|
|
289
|
+
j,
|
|
266
290
|
g,
|
|
267
|
-
L,
|
|
268
291
|
c,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
p,
|
|
272
|
-
T,
|
|
273
|
-
C,
|
|
274
|
-
u,
|
|
275
|
-
M,
|
|
276
|
-
b
|
|
292
|
+
P,
|
|
293
|
+
k
|
|
277
294
|
]);
|
|
278
|
-
return /* @__PURE__ */
|
|
279
|
-
|
|
280
|
-
|
|
295
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
296
|
+
Q,
|
|
297
|
+
I && /* @__PURE__ */ e.jsx(
|
|
281
298
|
ge,
|
|
282
299
|
{
|
|
283
|
-
size:
|
|
284
|
-
open:
|
|
285
|
-
anchorEl:
|
|
286
|
-
list:
|
|
287
|
-
idMenuLast:
|
|
288
|
-
selectMenu:
|
|
289
|
-
onClickMenu:
|
|
290
|
-
onMouseEnter:
|
|
291
|
-
onMouseLeave:
|
|
300
|
+
size: c,
|
|
301
|
+
open: I,
|
|
302
|
+
anchorEl: Y,
|
|
303
|
+
list: B,
|
|
304
|
+
idMenuLast: N,
|
|
305
|
+
selectMenu: y,
|
|
306
|
+
onClickMenu: l,
|
|
307
|
+
onMouseEnter: d,
|
|
308
|
+
onMouseLeave: v,
|
|
292
309
|
onMouseEnterBus: W,
|
|
293
310
|
onMouseLeaveBus: re,
|
|
294
|
-
color:
|
|
295
|
-
level:
|
|
296
|
-
jumpIcon:
|
|
297
|
-
onClickJump:
|
|
311
|
+
color: g,
|
|
312
|
+
level: m + 1,
|
|
313
|
+
jumpIcon: k,
|
|
314
|
+
onClickJump: P
|
|
298
315
|
}
|
|
299
316
|
)
|
|
300
317
|
] });
|
|
301
|
-
}, ue = (
|
|
302
|
-
if (!
|
|
318
|
+
}, ue = (h) => {
|
|
319
|
+
if (!h) return 0;
|
|
303
320
|
try {
|
|
304
|
-
const
|
|
305
|
-
return Number(
|
|
321
|
+
const c = h.match(/translate3d\((.*)px, (.*)px, (.*)px\)/);
|
|
322
|
+
return Number(c && c[2]);
|
|
306
323
|
} catch {
|
|
307
324
|
}
|
|
308
325
|
return 0;
|
|
309
|
-
}, we = (
|
|
326
|
+
}, we = (h) => {
|
|
310
327
|
const {
|
|
311
|
-
list:
|
|
312
|
-
expansion:
|
|
313
|
-
selectMenu:
|
|
314
|
-
onClickMenu:
|
|
315
|
-
className:
|
|
316
|
-
shrinkOthers:
|
|
317
|
-
size:
|
|
318
|
-
jumpIcon:
|
|
319
|
-
onClickJump:
|
|
320
|
-
color:
|
|
321
|
-
} =
|
|
322
|
-
|
|
323
|
-
clearTimeout(
|
|
324
|
-
}, []),
|
|
325
|
-
const
|
|
326
|
-
for (let
|
|
327
|
-
const
|
|
328
|
-
|
|
328
|
+
list: c,
|
|
329
|
+
expansion: E = !0,
|
|
330
|
+
selectMenu: T = "",
|
|
331
|
+
onClickMenu: N,
|
|
332
|
+
className: y,
|
|
333
|
+
shrinkOthers: l = !0,
|
|
334
|
+
size: O = "large",
|
|
335
|
+
jumpIcon: d,
|
|
336
|
+
onClickJump: v,
|
|
337
|
+
color: L
|
|
338
|
+
} = h, [f, m] = C([]), [g, j] = C(!1), [k, P] = C(null), [I, _] = C(""), [Y, w] = C([]), [B, F] = C(""), [S, U] = C({}), [p, $] = C({ prev: !1, next: !1 }), [x] = C({}), a = Te.useRef(null);
|
|
339
|
+
A(() => () => {
|
|
340
|
+
clearTimeout(x.arrowTimer), clearTimeout(x.leaveTimer), clearTimeout(x.enterTimer);
|
|
341
|
+
}, []), A(() => {
|
|
342
|
+
const n = c || [], s = [];
|
|
343
|
+
for (let r = 0, b = n.length; r < b; r++) {
|
|
344
|
+
const ee = n[r];
|
|
345
|
+
s.push({ ...ee });
|
|
329
346
|
}
|
|
330
|
-
ne(
|
|
331
|
-
}, [
|
|
332
|
-
|
|
333
|
-
}, [
|
|
334
|
-
|
|
335
|
-
}, [
|
|
336
|
-
const
|
|
337
|
-
clearTimeout(
|
|
338
|
-
if (!
|
|
339
|
-
const { min:
|
|
340
|
-
|
|
347
|
+
ne(s);
|
|
348
|
+
}, [c]), A(() => {
|
|
349
|
+
R();
|
|
350
|
+
}, [f]), A(() => {
|
|
351
|
+
T !== B && F(T), R();
|
|
352
|
+
}, [T]);
|
|
353
|
+
const R = () => {
|
|
354
|
+
clearTimeout(x.arrowTimer), x.arrowTimer = setTimeout(() => {
|
|
355
|
+
if (!a.current) return;
|
|
356
|
+
const { min: n, max: s } = V(), r = ue(a.current.style.transform);
|
|
357
|
+
$({ prev: r !== n, next: r > s });
|
|
341
358
|
}, 300);
|
|
342
|
-
},
|
|
343
|
-
if (!
|
|
344
|
-
|
|
345
|
-
const { deltaY:
|
|
346
|
-
let
|
|
347
|
-
|
|
348
|
-
},
|
|
349
|
-
if (!
|
|
350
|
-
const
|
|
351
|
-
let
|
|
352
|
-
switch (
|
|
359
|
+
}, o = (n) => {
|
|
360
|
+
if (!a.current) return;
|
|
361
|
+
a.current.style.transition = "none";
|
|
362
|
+
const { deltaY: s } = n;
|
|
363
|
+
let r = ue(a.current.style.transform);
|
|
364
|
+
r -= s, H(r);
|
|
365
|
+
}, M = (n) => () => {
|
|
366
|
+
if (!a.current) return;
|
|
367
|
+
const s = 100;
|
|
368
|
+
let r = ue(a.current.style.transform);
|
|
369
|
+
switch (n) {
|
|
353
370
|
case "next":
|
|
354
|
-
|
|
371
|
+
r -= s;
|
|
355
372
|
break;
|
|
356
373
|
case "prev":
|
|
357
|
-
|
|
374
|
+
r += s;
|
|
358
375
|
break;
|
|
359
376
|
}
|
|
360
|
-
|
|
361
|
-
},
|
|
362
|
-
if (!
|
|
363
|
-
const { min:
|
|
364
|
-
|
|
377
|
+
H(r);
|
|
378
|
+
}, H = (n) => {
|
|
379
|
+
if (!a.current) return;
|
|
380
|
+
const { min: s, max: r } = V();
|
|
381
|
+
n > s && (n = s), n < r && (n = r), $({ prev: n !== s, next: n > r }), a.current.style.transform = `translate3d(0, ${n}px, 0)`, a.current.style.transition = "all .3s";
|
|
365
382
|
}, V = () => {
|
|
366
|
-
if (!
|
|
383
|
+
if (!a.current || !a.current.parentNode)
|
|
367
384
|
return { min: 0, max: 0 };
|
|
368
|
-
const
|
|
369
|
-
let
|
|
370
|
-
return
|
|
371
|
-
}, ne = (
|
|
372
|
-
const
|
|
373
|
-
for (let ae = 0, Ce =
|
|
374
|
-
const
|
|
375
|
-
if (
|
|
376
|
-
const
|
|
377
|
-
|
|
385
|
+
const n = a.current.parentNode.getBoundingClientRect().height, s = 0;
|
|
386
|
+
let r = -(a.current.getBoundingClientRect().height - n);
|
|
387
|
+
return n > a.current.getBoundingClientRect().height && (r = 0), { min: s, max: r };
|
|
388
|
+
}, ne = (n) => {
|
|
389
|
+
const s = {}, r = {}, b = (ee, xe) => {
|
|
390
|
+
for (let ae = 0, Ce = ee.length; ae < Ce; ae++) {
|
|
391
|
+
const J = ee[ae], q = J.path || "";
|
|
392
|
+
if (J._paraui_menu_id = `_paraui_menu_id_${Ee()}`, xe) {
|
|
393
|
+
const ve = ye(s[xe.path || ""] || []);
|
|
394
|
+
ve.push(q), s[q] = [...ve];
|
|
378
395
|
} else
|
|
379
|
-
|
|
380
|
-
|
|
396
|
+
s[q] = [q], J._paraui_menu_first = !0;
|
|
397
|
+
J.children && J.children.length > 0 ? b(J.children, J) : r[q] = s[q];
|
|
381
398
|
}
|
|
382
399
|
};
|
|
383
|
-
|
|
384
|
-
}, te = (
|
|
385
|
-
|
|
386
|
-
clearTimeout(
|
|
387
|
-
let
|
|
388
|
-
|
|
400
|
+
b(n), U(r), m(n);
|
|
401
|
+
}, te = (n, s) => (r) => {
|
|
402
|
+
j(!1), clearTimeout(x.enterTimer), x.enterTimer = setTimeout(() => {
|
|
403
|
+
clearTimeout(x.leaveTimer);
|
|
404
|
+
let b = [n];
|
|
405
|
+
n.children && n.children.length > 0 && (b = n.children), P(s), _(r.target.getAttribute("data-menu-id") || ""), w(b), j(!0);
|
|
389
406
|
});
|
|
390
|
-
}, se = (
|
|
407
|
+
}, se = (n) => (s) => {
|
|
391
408
|
W();
|
|
392
409
|
}, W = () => {
|
|
393
|
-
clearTimeout(
|
|
394
|
-
|
|
410
|
+
clearTimeout(x.leaveTimer), x.leaveTimer = setTimeout(() => {
|
|
411
|
+
K();
|
|
395
412
|
}, 50);
|
|
396
413
|
}, re = () => {
|
|
397
|
-
clearTimeout(
|
|
414
|
+
clearTimeout(x.leaveTimer);
|
|
398
415
|
}, oe = () => {
|
|
399
416
|
W();
|
|
400
|
-
},
|
|
401
|
-
|
|
402
|
-
}, le = (
|
|
403
|
-
const { icon:
|
|
404
|
-
if (
|
|
405
|
-
const
|
|
406
|
-
return
|
|
417
|
+
}, K = () => {
|
|
418
|
+
j(!1), _(""), w([]), P(null);
|
|
419
|
+
}, le = (n) => {
|
|
420
|
+
const { icon: s, label: r } = n;
|
|
421
|
+
if (s) {
|
|
422
|
+
const b = pe[s];
|
|
423
|
+
return b ? b() : s;
|
|
407
424
|
}
|
|
408
|
-
return typeof
|
|
409
|
-
}, ie = (
|
|
410
|
-
if (
|
|
411
|
-
return /* @__PURE__ */
|
|
412
|
-
}, ce = (
|
|
413
|
-
if (!
|
|
414
|
-
const
|
|
415
|
-
delete
|
|
425
|
+
return typeof r == "string" ? r[0] : r;
|
|
426
|
+
}, ie = (n) => {
|
|
427
|
+
if (n.badge !== void 0)
|
|
428
|
+
return /* @__PURE__ */ e.jsx("div", { className: "menu-item-shrink-badge", children: /* @__PURE__ */ e.jsx("span", { children: n.badge }) });
|
|
429
|
+
}, ce = (n) => (s) => {
|
|
430
|
+
if (!n.children || n.children.length === 0) {
|
|
431
|
+
const r = { ...n };
|
|
432
|
+
delete r._paraui_menu_id, N && N(r);
|
|
416
433
|
}
|
|
417
|
-
|
|
418
|
-
},
|
|
419
|
-
if (
|
|
420
|
-
return
|
|
421
|
-
|
|
422
|
-
const
|
|
423
|
-
delete
|
|
424
|
-
}, t = (
|
|
425
|
-
let
|
|
426
|
-
const
|
|
427
|
-
return
|
|
434
|
+
s.preventDefault();
|
|
435
|
+
}, Q = (n) => {
|
|
436
|
+
if (n === !1)
|
|
437
|
+
return R();
|
|
438
|
+
K();
|
|
439
|
+
const s = { ...n };
|
|
440
|
+
delete s._paraui_menu_id, N && N(s);
|
|
441
|
+
}, t = (n, s) => {
|
|
442
|
+
let r = "vertical-menu-list-item-shrink";
|
|
443
|
+
const b = S?.[B || ""];
|
|
444
|
+
return b && b.indexOf(n.path || "") !== -1 && (r += " vertical-menu-list-item-shrink-select"), k === s && (r += " vertical-menu-list-item-shrink-hover"), r;
|
|
428
445
|
}, i = () => {
|
|
429
|
-
let
|
|
430
|
-
return
|
|
431
|
-
},
|
|
432
|
-
if (
|
|
433
|
-
return
|
|
434
|
-
|
|
446
|
+
let n = "vertical-menu-list";
|
|
447
|
+
return y && (n += ` ${y}`), n;
|
|
448
|
+
}, u = D(() => {
|
|
449
|
+
if (E)
|
|
450
|
+
return f.map((n, s) => /* @__PURE__ */ Ne(
|
|
451
|
+
de,
|
|
435
452
|
{
|
|
436
|
-
...
|
|
437
|
-
key:
|
|
453
|
+
...n,
|
|
454
|
+
key: s,
|
|
438
455
|
level: 1,
|
|
439
|
-
jumpIcon:
|
|
440
|
-
onClickJump:
|
|
441
|
-
idMenuLast:
|
|
442
|
-
selectMenu:
|
|
443
|
-
onClickMenu:
|
|
444
|
-
shrinkOthers:
|
|
456
|
+
jumpIcon: n.jumpIcon || d,
|
|
457
|
+
onClickJump: n.onClickJump || v,
|
|
458
|
+
idMenuLast: S,
|
|
459
|
+
selectMenu: B,
|
|
460
|
+
onClickMenu: Q,
|
|
461
|
+
shrinkOthers: l
|
|
445
462
|
}
|
|
446
463
|
));
|
|
447
|
-
}, [
|
|
448
|
-
const
|
|
449
|
-
return /* @__PURE__ */
|
|
450
|
-
|
|
464
|
+
}, [E, f, S, B, N, l, d, v]), X = D(() => E ? null : f.map((n, s) => {
|
|
465
|
+
const r = he(n.children);
|
|
466
|
+
return /* @__PURE__ */ e.jsx(
|
|
467
|
+
r,
|
|
451
468
|
{
|
|
452
|
-
className: t(
|
|
453
|
-
onMouseEnter: te(
|
|
469
|
+
className: t(n, s),
|
|
470
|
+
onMouseEnter: te(n, s),
|
|
454
471
|
onMouseLeave: se(),
|
|
455
|
-
"data-menu-id":
|
|
456
|
-
onClick: ce(
|
|
457
|
-
...
|
|
458
|
-
children: /* @__PURE__ */
|
|
459
|
-
le(
|
|
460
|
-
ie(
|
|
472
|
+
"data-menu-id": n._paraui_menu_id,
|
|
473
|
+
onClick: ce(n),
|
|
474
|
+
...fe(n.children, n.path, n.href),
|
|
475
|
+
children: /* @__PURE__ */ e.jsxs("span", { className: "vertical-menu-list-item-shrink-content", children: [
|
|
476
|
+
le(n),
|
|
477
|
+
ie(n)
|
|
461
478
|
] })
|
|
462
479
|
},
|
|
463
|
-
|
|
480
|
+
s
|
|
464
481
|
);
|
|
465
|
-
}), [
|
|
482
|
+
}), [E, f, S, B, k]), Z = D(() => /* @__PURE__ */ e.jsx(e.Fragment, { children: p.prev && /* @__PURE__ */ e.jsx("div", { className: "scroll-top", children: /* @__PURE__ */ e.jsx("span", { onClick: M("prev"), children: /* @__PURE__ */ e.jsx(G, {}) }) }) }), [p]), je = D(() => /* @__PURE__ */ e.jsx(e.Fragment, { children: p.next && /* @__PURE__ */ e.jsx("div", { className: "scroll-bottom", children: /* @__PURE__ */ e.jsx("span", { onClick: M("next"), children: /* @__PURE__ */ e.jsx(G, {}) }) }) }), [p]), Me = D(() => /* @__PURE__ */ e.jsx(e.Fragment, { children: g && /* @__PURE__ */ e.jsx(
|
|
466
483
|
ge,
|
|
467
484
|
{
|
|
468
|
-
open:
|
|
469
|
-
anchorEl:
|
|
470
|
-
list:
|
|
471
|
-
idMenuLast:
|
|
472
|
-
selectMenu:
|
|
473
|
-
onClickMenu:
|
|
485
|
+
open: g,
|
|
486
|
+
anchorEl: I,
|
|
487
|
+
list: Y,
|
|
488
|
+
idMenuLast: S,
|
|
489
|
+
selectMenu: B,
|
|
490
|
+
onClickMenu: Q,
|
|
474
491
|
onMouseEnter: re,
|
|
475
492
|
onMouseLeave: oe,
|
|
476
|
-
color:
|
|
493
|
+
color: L,
|
|
477
494
|
level: 1,
|
|
478
|
-
size:
|
|
479
|
-
jumpIcon:
|
|
480
|
-
onClickJump:
|
|
495
|
+
size: O,
|
|
496
|
+
jumpIcon: d,
|
|
497
|
+
onClickJump: v
|
|
481
498
|
}
|
|
482
499
|
) }), [
|
|
483
|
-
C,
|
|
484
|
-
S,
|
|
485
|
-
H,
|
|
486
|
-
_,
|
|
487
|
-
y,
|
|
488
500
|
g,
|
|
489
|
-
|
|
490
|
-
|
|
501
|
+
I,
|
|
502
|
+
Y,
|
|
503
|
+
S,
|
|
491
504
|
B,
|
|
492
|
-
|
|
493
|
-
|
|
505
|
+
N,
|
|
506
|
+
x,
|
|
507
|
+
L,
|
|
508
|
+
O,
|
|
509
|
+
d,
|
|
510
|
+
v
|
|
494
511
|
]);
|
|
495
|
-
return /* @__PURE__ */
|
|
496
|
-
/* @__PURE__ */
|
|
512
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
513
|
+
/* @__PURE__ */ e.jsxs(
|
|
497
514
|
"div",
|
|
498
515
|
{
|
|
499
516
|
className: i(),
|
|
500
|
-
onWheel:
|
|
517
|
+
onWheel: o,
|
|
501
518
|
children: [
|
|
502
|
-
|
|
503
|
-
/* @__PURE__ */
|
|
519
|
+
Z,
|
|
520
|
+
/* @__PURE__ */ e.jsx("div", { className: "vertical-menu-list-box", children: /* @__PURE__ */ e.jsxs(
|
|
504
521
|
"div",
|
|
505
522
|
{
|
|
506
523
|
className: "vertical-menu-list-box-srcoll",
|
|
507
|
-
ref:
|
|
524
|
+
ref: a,
|
|
508
525
|
children: [
|
|
509
|
-
|
|
510
|
-
|
|
526
|
+
u,
|
|
527
|
+
X
|
|
511
528
|
]
|
|
512
529
|
}
|
|
513
530
|
) }),
|