@unicom-cloud/ui 0.8.61 → 0.8.63
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/Affix.js +1 -1
- package/Alert.js +44 -40
- package/Anchor.js +1 -1
- package/AutoComplete.js +4 -4
- package/Avatar.js +1 -1
- package/BackTop.js +7 -7
- package/Badge.js +2 -2
- package/Breadcrumb.js +22 -22
- package/Button.js +2 -2
- package/Calendar.js +106 -104
- package/Card.js +1 -1
- package/Carousel.js +34 -33
- package/Cascader.js +1 -1
- package/Checkbox.js +1 -1
- package/Collapse.js +1 -1
- package/ColorPicker.js +12 -12
- package/Comment.js +1 -1
- package/ConfigProvider.js +2 -2
- package/Copy.js +16 -16
- package/DatePicker.js +1021 -1008
- package/Descriptions.js +10 -10
- package/Divider.js +1 -1
- package/Draggable.js +1 -1
- package/Drawer.js +1 -1
- package/Dropdown.js +9 -9
- package/Empty.js +2 -2
- package/Form.js +60 -54
- package/Grid.js +2 -2
- package/Icon.js +1 -1
- package/IconHover.js +1 -1
- package/Image.js +1 -1
- package/Input.js +1 -1
- package/InputNumber.js +6 -6
- package/InputTag.js +1 -1
- package/Layout.js +2 -2
- package/Link.js +14 -14
- package/List.js +3 -3
- package/Mentions.js +3 -3
- package/Menu.js +1 -1
- package/Message.js +2 -2
- package/Modal.js +1 -1
- package/Notice.js +9 -3
- package/Notification.js +2 -2
- package/OverflowEllipsis.js +32 -32
- package/PageHeader.js +23 -22
- package/Pagination.js +1 -1
- package/Picker.js +1 -1
- package/Popconfirm.js +7 -7
- package/Popover.js +1 -1
- package/Progress.js +14 -14
- package/Radio.js +2 -2
- package/Rate.js +43 -40
- package/ResizeBox.js +97 -96
- package/Result.js +15 -15
- package/Select.js +1 -1
- package/SelectView.js +295 -249
- package/Skeleton.js +1 -1
- package/Slider.js +25 -25
- package/Space.js +32 -32
- package/SpeechSynthesis.js +32 -29
- package/Spin.js +2 -2
- package/Statistic.js +1 -1
- package/Steps.js +11 -11
- package/Switch.js +3 -3
- package/Table.js +9 -9
- package/Tabs.js +1 -1
- package/Tag.js +68 -67
- package/TimePicker.js +17 -17
- package/Timeline.js +1 -1
- package/Tooltip.js +1 -1
- package/Transfer.js +47 -46
- package/Tree.js +2 -2
- package/TreeSelect.js +1 -1
- package/Trigger.js +3 -3
- package/Typography.js +1 -1
- package/Upload.js +2 -2
- package/VerificationCode.js +1 -1
- package/Version.js +1 -1
- package/Watermark.js +1 -1
- package/chunk/{DhBo0pPJ.js → B5gIo-hD.js} +119 -118
- package/chunk/{eK7lxdak.js → B9w_puFP.js} +8 -8
- package/chunk/{RMBPs_Ry.js → BEB_A9eY.js} +4 -3
- package/chunk/{CuOl4X0X.js → BLLKKgZJ.js} +1 -1
- package/chunk/{cZiP8FvM.js → BcwdVUDs.js} +1 -1
- package/chunk/{C1xMmQIZ.js → BmO1y0vr.js} +34 -34
- package/chunk/{DmUhn9ib.js → Bn2-vqTg.js} +54 -53
- package/chunk/{Kbr6FzOG.js → BnLshM9R.js} +210 -186
- package/chunk/{BJ_7JTqC.js → BoDdbbF_.js} +1 -1
- package/chunk/BsWphzcT.js +20 -0
- package/chunk/{Bdh4XVuf.js → C5S_amaH.js} +290 -281
- package/chunk/{YIlBPVAs.js → C6Zb_-OE.js} +1 -1
- package/chunk/{CbiWdbr_.js → CAxIyiy6.js} +35 -34
- package/chunk/CD7dGcUa.js +376 -0
- package/chunk/{BPZ-6HKJ.js → CLBavO5c.js} +24 -22
- package/chunk/{B2vORJQ8.js → CZ1wrD_H.js} +13 -13
- package/chunk/{DpfUGhi4.js → CfTcP6nF.js} +288 -283
- package/chunk/{BNHrEI0Y.js → CfZWOhnc.js} +52 -48
- package/chunk/{BjSHZA0m.js → CgDayZDE.js} +1 -1
- package/chunk/{BYhtrDV3.js → Co3idurS.js} +152 -148
- package/chunk/{BBVjSFnw.js → Cqyp4qni.js} +23 -19
- package/chunk/{Cbd50gx8.js → CvlD3aiv.js} +33 -33
- package/chunk/{IooeSKJJ.js → D3dcFbex.js} +19 -19
- package/chunk/{C5AQWbC4.js → DDDuw0Zi.js} +1 -1
- package/chunk/{gIbzjQ-X.js → DXZ8-ha7.js} +2 -2
- package/chunk/{C1D7T29r.js → DbLgopUR.js} +83 -76
- package/chunk/{BVLwPZis.js → DbPYtS7-.js} +31 -30
- package/chunk/{V6euPXVB.js → Dk6hL04k.js} +257 -251
- package/chunk/{BEDYCG-I.js → Dpzgtdt-.js} +18 -18
- package/chunk/{B16KHtX-.js → JpKOcIfl.js} +191 -185
- package/chunk/{D2HkyI6A.js → QFkhCtUr.js} +11 -11
- package/chunk/aqSmxUbY.js +116 -0
- package/chunk/{DSGRHf-1.js → rlfmXePI.js} +157 -156
- package/hooks/useMergeValue.js +1 -1
- package/icons.js +4 -6001
- package/index.js +439 -393
- package/locale/en-US.js +1 -1
- package/locale/tr-TR.js +1 -1
- package/locale/zh-CN.js +8 -0
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/cascader/panel/Search.d.ts +1 -1
- package/types/color-picker/hooks/useColorPicker.d.ts +3 -8
- package/types/config-provider/interface.d.ts +1 -1
- package/types/date-picker/index.d.ts +7 -0
- package/types/form/interface.d.ts +1 -1
- package/types/index.d.ts +3 -3
- package/types/locale/interface.d.ts +1 -0
- package/types/locale/zh-CN.d.ts +14 -0
- package/types/message/index.d.ts +2 -2
- package/types/notification/index.d.ts +2 -2
- package/types/notification-base/index.d.ts +2 -2
- package/types/select/interface.d.ts +1 -0
- package/types/select-view/interface.d.ts +1 -0
- package/types/space/index.d.ts +2 -1
- package/types/tree/Context.d.ts +1 -0
- package/types/tree/Tree.d.ts +1 -1
- package/types/tree/index.d.ts +5 -4
- package/types/tree/interface.d.ts +1 -0
- package/types/utils/index.d.ts +1 -0
- package/types/utils/is.d.ts +2 -0
- package/types/utils/lodash.d.ts +14 -1
- package/types/verification-code/VerificationCode.d.ts +2 -1
- package/types/version/index.d.ts +1 -1
- package/utils/CSSTransition.js +1 -1
- package/utils/caseName.js +2 -18
- package/utils/contextHolder.js +1 -1
- package/utils/dayjs.js +50 -49
- package/utils/index.js +227 -185
- package/utils/is.js +125 -111
- package/utils/lodash.js +32 -6
- package/utils/reactDOM.js +1 -1
- package/chunk/-LZOUh53.js +0 -29
- package/chunk/-jdfq71f.js +0 -23
- package/chunk/B0GOLsj_.js +0 -58
- package/chunk/B7Zsp3gO.js +0 -29
- package/chunk/BDjXkzNj.js +0 -23
- package/chunk/BHn4xgbv.js +0 -209
- package/chunk/BLSiP_gg.js +0 -32
- package/chunk/BMJfSSLX.js +0 -23
- package/chunk/B_nfMl0e.js +0 -116
- package/chunk/BcS17Pzy.js +0 -66
- package/chunk/BdiEwtQO.js +0 -41
- package/chunk/Bpug_KxP.js +0 -34
- package/chunk/C1u_ckwU.js +0 -29
- package/chunk/C43Hv2Bl.js +0 -34
- package/chunk/C9vsih_D.js +0 -29
- package/chunk/CAfR2wLq.js +0 -41
- package/chunk/CAfecMDF.js +0 -46
- package/chunk/CKp4rZnD.js +0 -207
- package/chunk/CV2Aqv9q.js +0 -52
- package/chunk/CYdarMv9.js +0 -32
- package/chunk/C_S5Mdvd.js +0 -379
- package/chunk/CmB-TL7C.js +0 -46
- package/chunk/D-ER56Sf.js +0 -29
- package/chunk/D-aYnb6u.js +0 -41
- package/chunk/D3xQFJcO.js +0 -23
- package/chunk/DJcEys80.js +0 -29
- package/chunk/DLIm6rRJ.js +0 -29
- package/chunk/DOWEHtqM.js +0 -41
- package/chunk/DT37l12z.js +0 -40
- package/chunk/DW-B7npC.js +0 -23
- package/chunk/D_MTFBb0.js +0 -38
- package/chunk/Dx_5J4fO.js +0 -29
- package/chunk/Dy487FZ1.js +0 -118
- package/chunk/Uz-rNulO.js +0 -98
- package/chunk/cDZI_t6o.js +0 -52
- package/chunk/sScV-J56.js +0 -206
- package/chunk/wI2I1qb0.js +0 -23
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import { jsx as i, jsxs as F, Fragment as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as i, jsxs as F, Fragment as we } from "react/jsx-runtime";
|
|
2
|
+
import Ae from "@unicom-cloud/icons/IconUiMenuFold";
|
|
3
|
+
import Ue from "@unicom-cloud/icons/IconUiMenuUnfold";
|
|
3
4
|
import He from "lodash/isPlainObject";
|
|
4
|
-
import L, { createContext as Be, useContext as K, forwardRef as X, useRef as J, useEffect as Z, useState as
|
|
5
|
-
import { d as
|
|
5
|
+
import L, { createContext as Be, useContext as K, forwardRef as X, useRef as J, useEffect as Z, useState as Ce, useMemo as Fe } from "react";
|
|
6
|
+
import { d as Ie } from "./C5S_amaH.js";
|
|
6
7
|
import { useForceUpdate as Ve } from "../hooks/useForceUpdate.js";
|
|
7
8
|
import { useId as le } from "../hooks/useId.js";
|
|
8
9
|
import { useKeyboardEvent as We } from "../hooks/useKeyboardEvent.js";
|
|
9
10
|
import { useMergeProps as Ge } from "../hooks/useMergeProps.js";
|
|
10
11
|
import { useMergeValue as re } from "../hooks/useMergeValue.js";
|
|
11
|
-
import { a as ze } from "./
|
|
12
|
-
import { y as
|
|
12
|
+
import { a as ze } from "./DbPYtS7-.js";
|
|
13
|
+
import { y as H } from "./BzPkh4Zv.js";
|
|
13
14
|
import z from "../utils/omit.js";
|
|
14
15
|
import { p as je } from "./CANaGbGR.js";
|
|
15
16
|
import { useIsFirstRender as qe } from "../hooks/useIsFirstRender.js";
|
|
16
17
|
import Qe from "../Tooltip.js";
|
|
17
18
|
import { E as ie, a as Ye, b as Je } from "./C2lIz2F9.js";
|
|
18
19
|
import { getStyle as ge } from "../utils/style.js";
|
|
19
|
-
import
|
|
20
|
+
import ve from "@unicom-cloud/icons/IconUiDown";
|
|
20
21
|
import { useStateWithPromise as Xe } from "../hooks/useStateWithPromise.js";
|
|
21
|
-
import { P as Ze } from "./
|
|
22
|
+
import { P as Ze } from "./CLBavO5c.js";
|
|
22
23
|
import en from "../utils/pick.js";
|
|
23
|
-
import
|
|
24
|
+
import nn from "@unicom-cloud/icons/IconUiLeft";
|
|
25
|
+
import tn from "@unicom-cloud/icons/IconUiRight";
|
|
24
26
|
import on from "../Dropdown.js";
|
|
25
|
-
const
|
|
27
|
+
const B = Be({});
|
|
26
28
|
function ee(l) {
|
|
27
|
-
const { prefixCls: o, levelIndent: e } = l, { collapse: s } = K(
|
|
29
|
+
const { prefixCls: o, levelIndent: e } = l, { collapse: s } = K(B), r = l.level - 1;
|
|
28
30
|
return !s && r > 0 ? /* @__PURE__ */ i("span", { children: [...new Array(r)].map((n, c) => /* @__PURE__ */ i(
|
|
29
31
|
"span",
|
|
30
32
|
{
|
|
@@ -50,17 +52,17 @@ const Ne = [
|
|
|
50
52
|
}, ke = (l, o = [], e = {}) => {
|
|
51
53
|
const s = Se(l);
|
|
52
54
|
return s.forEach((r, n) => {
|
|
53
|
-
var p,
|
|
55
|
+
var p, C;
|
|
54
56
|
const c = r.key, u = r.type.menuType, h = [c, ...o], y = {
|
|
55
57
|
keyPath: [],
|
|
56
58
|
prev: ((p = s[n - 1]) == null ? void 0 : p.key) || null,
|
|
57
|
-
next: ((
|
|
59
|
+
next: ((C = s[n + 1]) == null ? void 0 : C.key) || null
|
|
58
60
|
};
|
|
59
61
|
if (n === 0 || n === s.length - 1) {
|
|
60
|
-
const a = h[1],
|
|
62
|
+
const a = h[1], S = n === 0 ? "firstChild" : "lastChild";
|
|
61
63
|
a && (e[a] = {
|
|
62
64
|
...e[a],
|
|
63
|
-
[
|
|
65
|
+
[S]: c
|
|
64
66
|
});
|
|
65
67
|
}
|
|
66
68
|
switch (u) {
|
|
@@ -118,52 +120,52 @@ function rn(l, o) {
|
|
|
118
120
|
wrapper: h = "div",
|
|
119
121
|
onClick: y,
|
|
120
122
|
renderItemInTooltip: p,
|
|
121
|
-
...
|
|
123
|
+
...C
|
|
122
124
|
} = l, {
|
|
123
125
|
prefixCls: a,
|
|
124
|
-
mode:
|
|
125
|
-
collapse:
|
|
126
|
+
mode: S,
|
|
127
|
+
collapse: E,
|
|
126
128
|
inDropdown: t,
|
|
127
|
-
levelIndent:
|
|
129
|
+
levelIndent: f,
|
|
128
130
|
selectedKeys: d,
|
|
129
|
-
autoScrollIntoView:
|
|
130
|
-
scrollConfig:
|
|
131
|
-
tooltipProps:
|
|
132
|
-
onClickMenuItem:
|
|
133
|
-
} = K(
|
|
131
|
+
autoScrollIntoView: g,
|
|
132
|
+
scrollConfig: b,
|
|
133
|
+
tooltipProps: w,
|
|
134
|
+
onClickMenuItem: v
|
|
135
|
+
} = K(B), m = J(null), x = qe(), P = S === "vertical" && r > 1, O = E && !t && r === 1, $ = d && ~d.indexOf(e);
|
|
134
136
|
Z(() => {
|
|
135
|
-
const k =
|
|
136
|
-
|
|
137
|
+
const k = $ && g;
|
|
138
|
+
m.current && k && setTimeout(
|
|
137
139
|
() => {
|
|
138
|
-
|
|
140
|
+
m.current && je(m.current, {
|
|
139
141
|
behavior: "smooth",
|
|
140
142
|
block: "start",
|
|
141
143
|
scrollMode: "if-needed",
|
|
142
144
|
boundary: document.body,
|
|
143
|
-
...
|
|
145
|
+
...b
|
|
144
146
|
});
|
|
145
147
|
},
|
|
146
|
-
|
|
148
|
+
x ? 500 : 0
|
|
147
149
|
);
|
|
148
|
-
}, [
|
|
150
|
+
}, [$, g]);
|
|
149
151
|
const A = (k) => {
|
|
150
|
-
n || (
|
|
151
|
-
},
|
|
152
|
+
n || (v == null || v(e, k), y == null || y(k));
|
|
153
|
+
}, I = /* @__PURE__ */ F(
|
|
152
154
|
h,
|
|
153
155
|
{
|
|
154
156
|
tabIndex: n ? -1 : 0,
|
|
155
157
|
role: "menuitem",
|
|
156
158
|
ref: (k) => {
|
|
157
|
-
o = k,
|
|
159
|
+
o = k, m.current = o;
|
|
158
160
|
},
|
|
159
161
|
style: u,
|
|
160
|
-
className:
|
|
162
|
+
className: H(
|
|
161
163
|
`${a}-item`,
|
|
162
164
|
{
|
|
163
165
|
[`${a}-disabled`]: n,
|
|
164
|
-
[`${a}-selected`]:
|
|
166
|
+
[`${a}-selected`]: $,
|
|
165
167
|
// 存在缩进dom
|
|
166
|
-
[`${a}-item-indented`]:
|
|
168
|
+
[`${a}-item-indented`]: P && !E
|
|
167
169
|
},
|
|
168
170
|
c
|
|
169
171
|
),
|
|
@@ -172,16 +174,16 @@ function rn(l, o) {
|
|
|
172
174
|
k.key === ie.key && A(k);
|
|
173
175
|
},
|
|
174
176
|
...z(
|
|
175
|
-
|
|
177
|
+
C,
|
|
176
178
|
["key", "_key"].concat(Ne)
|
|
177
179
|
),
|
|
178
180
|
children: [
|
|
179
|
-
|
|
181
|
+
P && !E ? /* @__PURE__ */ F(we, { children: [
|
|
180
182
|
/* @__PURE__ */ i(
|
|
181
183
|
ee,
|
|
182
184
|
{
|
|
183
185
|
prefixCls: a,
|
|
184
|
-
levelIndent:
|
|
186
|
+
levelIndent: f,
|
|
185
187
|
level: r
|
|
186
188
|
}
|
|
187
189
|
),
|
|
@@ -196,7 +198,7 @@ function rn(l, o) {
|
|
|
196
198
|
}
|
|
197
199
|
)
|
|
198
200
|
] }) : s,
|
|
199
|
-
|
|
201
|
+
$ && S === "horizontal" ? /* @__PURE__ */ i("div", { className: `${a}-selected-label` }) : null
|
|
200
202
|
]
|
|
201
203
|
}
|
|
202
204
|
);
|
|
@@ -208,25 +210,25 @@ function rn(l, o) {
|
|
|
208
210
|
content: typeof p == "function" ? p() : /* @__PURE__ */ i("span", { children: s }),
|
|
209
211
|
triggerProps: {
|
|
210
212
|
className: `${a}-item-tooltip`,
|
|
211
|
-
...(
|
|
213
|
+
...(w == null ? void 0 : w.triggerProps) || {}
|
|
212
214
|
},
|
|
213
|
-
...z(
|
|
214
|
-
children:
|
|
215
|
+
...z(w, ["triggerProps"]),
|
|
216
|
+
children: I
|
|
215
217
|
}
|
|
216
|
-
) :
|
|
218
|
+
) : I;
|
|
217
219
|
}
|
|
218
220
|
const sn = X(rn), ce = sn;
|
|
219
221
|
ce.displayName = "MenuItem";
|
|
220
222
|
ce.menuType = "MenuItem";
|
|
221
223
|
function ln(l, o) {
|
|
222
|
-
const { children: e, title: s, level: r, className: n, style: c } = l, { prefixCls: u, levelIndent: h } = K(
|
|
224
|
+
const { children: e, title: s, level: r, className: n, style: c } = l, { prefixCls: u, levelIndent: h } = K(B), y = r === 1 ? r + 1 : r, p = ne(e, {
|
|
223
225
|
level: y
|
|
224
226
|
});
|
|
225
227
|
return /* @__PURE__ */ F(
|
|
226
228
|
"div",
|
|
227
229
|
{
|
|
228
230
|
ref: o,
|
|
229
|
-
className:
|
|
231
|
+
className: H(`${u}-group`, n),
|
|
230
232
|
style: c,
|
|
231
233
|
children: [
|
|
232
234
|
/* @__PURE__ */ F("div", { className: `${u}-group-title`, children: [
|
|
@@ -261,53 +263,53 @@ const se = { height: 0, visibility: "hidden" }, an = (l) => {
|
|
|
261
263
|
...y
|
|
262
264
|
} = l, {
|
|
263
265
|
id: p,
|
|
264
|
-
prefixCls:
|
|
266
|
+
prefixCls: C,
|
|
265
267
|
levelIndent: a,
|
|
266
|
-
openKeys:
|
|
267
|
-
selectedKeys:
|
|
268
|
+
openKeys: S = [],
|
|
269
|
+
selectedKeys: E = [],
|
|
268
270
|
icons: t,
|
|
269
|
-
onClickSubMenu:
|
|
271
|
+
onClickSubMenu: f,
|
|
270
272
|
onClickMenuItem: d
|
|
271
|
-
} = K(
|
|
272
|
-
|
|
273
|
-
),
|
|
274
|
-
|
|
275
|
-
},
|
|
273
|
+
} = K(B), g = `${C}-inline`, b = (S == null ? void 0 : S.indexOf(o)) > -1, w = h && E.indexOf(l._key) > -1 || xe(e, E), [v, m] = Xe(
|
|
274
|
+
b ? { height: "auto" } : se
|
|
275
|
+
), x = (I) => {
|
|
276
|
+
f(o, c, "inline"), h && d(o, I);
|
|
277
|
+
}, P = le(`${p}-submenu-inline-`), O = ne(e, {
|
|
276
278
|
...en(y, Ne),
|
|
277
279
|
level: c + 1,
|
|
278
280
|
selectable: h
|
|
279
|
-
}),
|
|
281
|
+
}), $ = /* @__PURE__ */ F(
|
|
280
282
|
"div",
|
|
281
283
|
{
|
|
282
284
|
tabIndex: 0,
|
|
283
|
-
"aria-expanded":
|
|
284
|
-
"aria-controls":
|
|
285
|
-
className:
|
|
286
|
-
[`${
|
|
285
|
+
"aria-expanded": b,
|
|
286
|
+
"aria-controls": P,
|
|
287
|
+
className: H(`${g}-header`, {
|
|
288
|
+
[`${C}-selected`]: w
|
|
287
289
|
}),
|
|
288
|
-
onClick:
|
|
289
|
-
onKeyDown: (
|
|
290
|
-
|
|
290
|
+
onClick: x,
|
|
291
|
+
onKeyDown: (I) => {
|
|
292
|
+
I.key === ie.key && x(I);
|
|
291
293
|
},
|
|
292
294
|
children: [
|
|
293
295
|
/* @__PURE__ */ i(
|
|
294
296
|
ee,
|
|
295
297
|
{
|
|
296
298
|
level: c,
|
|
297
|
-
prefixCls:
|
|
299
|
+
prefixCls: C,
|
|
298
300
|
levelIndent: a
|
|
299
301
|
}
|
|
300
302
|
),
|
|
301
303
|
/* @__PURE__ */ i("span", { children: n }),
|
|
302
|
-
/* @__PURE__ */ i("span", { className: `${
|
|
304
|
+
/* @__PURE__ */ i("span", { className: `${C}-icon-suffix ${b ? "is-open" : ""}`, children: t && t.horizontalArrowDown ? t.horizontalArrowDown : /* @__PURE__ */ i(ve, {}) })
|
|
303
305
|
]
|
|
304
306
|
}
|
|
305
307
|
), A = /* @__PURE__ */ i(
|
|
306
308
|
"div",
|
|
307
309
|
{
|
|
308
|
-
id:
|
|
309
|
-
className:
|
|
310
|
-
style:
|
|
310
|
+
id: P,
|
|
311
|
+
className: H(`${g}-content`),
|
|
312
|
+
style: v,
|
|
311
313
|
children: O
|
|
312
314
|
}
|
|
313
315
|
);
|
|
@@ -315,26 +317,26 @@ const se = { height: 0, visibility: "hidden" }, an = (l) => {
|
|
|
315
317
|
"div",
|
|
316
318
|
{
|
|
317
319
|
ref: u,
|
|
318
|
-
className:
|
|
320
|
+
className: H(g, r),
|
|
319
321
|
style: s,
|
|
320
322
|
...z(y, ["key", "popup", "triggerProps"]),
|
|
321
323
|
children: [
|
|
322
|
-
|
|
324
|
+
$,
|
|
323
325
|
/* @__PURE__ */ i(
|
|
324
326
|
Ze,
|
|
325
327
|
{
|
|
326
|
-
in:
|
|
328
|
+
in: b,
|
|
327
329
|
timeout: 200,
|
|
328
|
-
classNames:
|
|
330
|
+
classNames: g,
|
|
329
331
|
unmountOnExit: !1,
|
|
330
|
-
onEnter: async (
|
|
331
|
-
|
|
332
|
+
onEnter: async (I) => {
|
|
333
|
+
I && (await m(se), await m({ height: I.scrollHeight }));
|
|
332
334
|
},
|
|
333
335
|
onEntered: () => {
|
|
334
|
-
|
|
336
|
+
m({ height: "auto" });
|
|
335
337
|
},
|
|
336
|
-
onExit: async (
|
|
337
|
-
|
|
338
|
+
onExit: async (I) => {
|
|
339
|
+
I && (await m({ height: I.scrollHeight }), await m(se));
|
|
338
340
|
},
|
|
339
341
|
children: A
|
|
340
342
|
}
|
|
@@ -355,35 +357,35 @@ const se = { height: 0, visibility: "hidden" }, an = (l) => {
|
|
|
355
357
|
triggerProps: y,
|
|
356
358
|
...p
|
|
357
359
|
} = l, {
|
|
358
|
-
id:
|
|
360
|
+
id: C,
|
|
359
361
|
prefixCls: a,
|
|
360
|
-
mode:
|
|
361
|
-
inDropdown:
|
|
362
|
+
mode: S,
|
|
363
|
+
inDropdown: E,
|
|
362
364
|
levelIndent: t,
|
|
363
|
-
selectedKeys:
|
|
365
|
+
selectedKeys: f = [],
|
|
364
366
|
icons: d,
|
|
365
|
-
triggerProps:
|
|
366
|
-
onClickSubMenu:
|
|
367
|
-
onClickMenuItem:
|
|
368
|
-
} = K(
|
|
369
|
-
const _ = d && d.popArrowRight ? d.popArrowRight :
|
|
370
|
-
return /* @__PURE__ */ i("span", { className: `${a}-icon-suffix`, children: A ?
|
|
371
|
-
}, V = xe(e,
|
|
372
|
-
|
|
367
|
+
triggerProps: g,
|
|
368
|
+
onClickSubMenu: b,
|
|
369
|
+
onClickMenuItem: w
|
|
370
|
+
} = K(B), { rtl: v } = K(Ie), m = { ...g, ...y }, [x, P] = Ce(!1), O = `${a}-pop`, $ = u && f.indexOf(l._key) > -1, A = S === "horizontal" && !E, I = le(`${C}-submenu-pop-`), k = () => {
|
|
371
|
+
const _ = d && d.popArrowRight ? d.popArrowRight : v ? /* @__PURE__ */ i(nn, {}) : /* @__PURE__ */ i(tn, {}), N = d && d.horizontalArrowDown ? d.horizontalArrowDown : /* @__PURE__ */ i(ve, {});
|
|
372
|
+
return /* @__PURE__ */ i("span", { className: `${a}-icon-suffix`, children: A ? N : _ });
|
|
373
|
+
}, V = xe(e, f) || $, G = v ? ["br", "lt"] : ["bl", "rt"], q = (_) => {
|
|
374
|
+
b(o, c, "pop"), u && w(o, _);
|
|
373
375
|
};
|
|
374
376
|
return /* @__PURE__ */ i(
|
|
375
377
|
on,
|
|
376
378
|
{
|
|
377
379
|
trigger: "hover",
|
|
378
|
-
popupVisible:
|
|
379
|
-
onVisibleChange:
|
|
380
|
+
popupVisible: x,
|
|
381
|
+
onVisibleChange: P,
|
|
380
382
|
droplist: /* @__PURE__ */ i(
|
|
381
383
|
j,
|
|
382
384
|
{
|
|
383
|
-
id:
|
|
384
|
-
selectedKeys:
|
|
385
|
-
onClickMenuItem: (_,
|
|
386
|
-
|
|
385
|
+
id: I,
|
|
386
|
+
selectedKeys: f,
|
|
387
|
+
onClickMenuItem: (_, N) => {
|
|
388
|
+
w(_, N), P(!1);
|
|
387
389
|
},
|
|
388
390
|
children: e
|
|
389
391
|
}
|
|
@@ -396,22 +398,22 @@ const se = { height: 0, visibility: "hidden" }, an = (l) => {
|
|
|
396
398
|
duration: 100,
|
|
397
399
|
mouseEnterDelay: 50,
|
|
398
400
|
mouseLeaveDelay: 50,
|
|
399
|
-
className:
|
|
401
|
+
className: H(
|
|
400
402
|
`${O}-trigger`,
|
|
401
|
-
|
|
403
|
+
m && m.className
|
|
402
404
|
),
|
|
403
|
-
...z(
|
|
405
|
+
...z(m, ["className"])
|
|
404
406
|
},
|
|
405
407
|
children: /* @__PURE__ */ F(
|
|
406
408
|
"div",
|
|
407
409
|
{
|
|
408
410
|
tabIndex: 0,
|
|
409
411
|
"aria-haspopup": !0,
|
|
410
|
-
"aria-expanded":
|
|
411
|
-
"aria-controls":
|
|
412
|
+
"aria-expanded": x,
|
|
413
|
+
"aria-controls": I,
|
|
412
414
|
ref: h,
|
|
413
415
|
style: s,
|
|
414
|
-
className:
|
|
416
|
+
className: H(
|
|
415
417
|
O,
|
|
416
418
|
`${O}-header`,
|
|
417
419
|
{
|
|
@@ -421,8 +423,8 @@ const se = { height: 0, visibility: "hidden" }, an = (l) => {
|
|
|
421
423
|
),
|
|
422
424
|
onClick: q,
|
|
423
425
|
onKeyDown: (_) => {
|
|
424
|
-
const
|
|
425
|
-
|
|
426
|
+
const N = _.key;
|
|
427
|
+
N === ie.key ? q(_) : N === Ye.key ? P(!1) : N === Je.key && P(!0);
|
|
426
428
|
},
|
|
427
429
|
...z(p, ["key", "popup"]),
|
|
428
430
|
children: [
|
|
@@ -436,7 +438,7 @@ const se = { height: 0, visibility: "hidden" }, an = (l) => {
|
|
|
436
438
|
),
|
|
437
439
|
n,
|
|
438
440
|
k(),
|
|
439
|
-
V &&
|
|
441
|
+
V && S === "horizontal" ? /* @__PURE__ */ i("div", { className: `${a}-selected-label` }) : null
|
|
440
442
|
]
|
|
441
443
|
}
|
|
442
444
|
)
|
|
@@ -444,10 +446,10 @@ const se = { height: 0, visibility: "hidden" }, an = (l) => {
|
|
|
444
446
|
);
|
|
445
447
|
};
|
|
446
448
|
function pn(l, o) {
|
|
447
|
-
const { children: e, popup: s, level: r } = l, { mode: n, collapse: c, inDropdown: u, collectInlineMenuKeys: h } = K(
|
|
449
|
+
const { children: e, popup: s, level: r } = l, { mode: n, collapse: c, inDropdown: u, collectInlineMenuKeys: h } = K(B), C = !!(typeof s == "function" ? s(r) : s) || c || u || n !== "vertical" ? un : an;
|
|
448
450
|
return Z(() => (h(l._key), () => {
|
|
449
451
|
h(l._key, !0);
|
|
450
|
-
}), []), /* @__PURE__ */ i(
|
|
452
|
+
}), []), /* @__PURE__ */ i(C, { forwardedRef: o, ...l, children: e });
|
|
451
453
|
}
|
|
452
454
|
const dn = X(pn), te = dn;
|
|
453
455
|
te.displayName = "SubMenu";
|
|
@@ -461,80 +463,84 @@ function be(l) {
|
|
|
461
463
|
return isNaN(o) ? 0 : o;
|
|
462
464
|
}
|
|
463
465
|
const mn = (l) => {
|
|
464
|
-
const { children: o, ellipsisText: e = "···", onEllipsisChange: s } = l, { prefixCls: r } = K(
|
|
466
|
+
const { children: o, ellipsisText: e = "···", onEllipsisChange: s } = l, { prefixCls: r } = K(B), n = J(null), [c, u] = Ce(null), h = `${r}-overflow-sub-menu`, y = `${r}-overflow-hidden-menu-item`, p = `${r}-overflow-sub-menu-mirror`, C = (t) => {
|
|
465
467
|
if (t !== c) {
|
|
466
|
-
const
|
|
468
|
+
const f = L.Children.toArray(o), d = t === null;
|
|
467
469
|
s == null || s({
|
|
468
|
-
lastVisibleIndex: d ?
|
|
469
|
-
overflowNodes: d ? [] :
|
|
470
|
+
lastVisibleIndex: d ? f.length - 1 : t,
|
|
471
|
+
overflowNodes: d ? [] : f.slice(t + 1)
|
|
470
472
|
}), u(t);
|
|
471
473
|
}
|
|
472
474
|
};
|
|
473
475
|
function a() {
|
|
474
476
|
if (!n.current)
|
|
475
477
|
return;
|
|
476
|
-
const t = n.current,
|
|
477
|
-
let
|
|
478
|
-
for (let
|
|
479
|
-
const
|
|
480
|
-
if (
|
|
478
|
+
const t = n.current, f = Me(t) - fn, d = [].slice.call(t.children);
|
|
479
|
+
let g = 0, b = 0, w = 0;
|
|
480
|
+
for (let v = 0; v < d.length; v++) {
|
|
481
|
+
const m = d[v], x = m.className.split(" "), P = x.indexOf(h) > -1, O = x.indexOf(p) > -1;
|
|
482
|
+
if (P)
|
|
481
483
|
continue;
|
|
482
|
-
const
|
|
484
|
+
const $ = Me(m) + be(ge(m, "marginLeft")) + be(ge(m, "marginRight"));
|
|
483
485
|
if (O) {
|
|
484
|
-
|
|
486
|
+
w = $;
|
|
485
487
|
continue;
|
|
486
488
|
}
|
|
487
|
-
if (
|
|
488
|
-
|
|
489
|
+
if (b += $, b > f) {
|
|
490
|
+
C(
|
|
489
491
|
// 判断如果将最后一个菜单项换为 ... 是否会超出宽度
|
|
490
|
-
|
|
492
|
+
g - (b - $ + w <= f ? 1 : 2)
|
|
491
493
|
);
|
|
492
494
|
return;
|
|
493
495
|
}
|
|
494
|
-
|
|
496
|
+
g++;
|
|
495
497
|
}
|
|
496
|
-
|
|
498
|
+
C(null);
|
|
497
499
|
}
|
|
498
|
-
const
|
|
500
|
+
const S = (t, f = !1) => /* @__PURE__ */ i(
|
|
499
501
|
te,
|
|
500
502
|
{
|
|
501
503
|
title: /* @__PURE__ */ i("span", { children: e }),
|
|
502
|
-
className:
|
|
504
|
+
className: f ? p : h,
|
|
503
505
|
children: t
|
|
504
506
|
},
|
|
505
|
-
`pqb-menu-overflow-sub-menu${
|
|
506
|
-
),
|
|
507
|
+
`pqb-menu-overflow-sub-menu${f ? "-mirror" : ""}`
|
|
508
|
+
), E = () => {
|
|
507
509
|
let t = null;
|
|
508
|
-
const
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
(
|
|
515
|
-
|
|
510
|
+
const f = S(null, !0), d = L.Children.map(o, (g, b) => {
|
|
511
|
+
var v;
|
|
512
|
+
let w = g;
|
|
513
|
+
if (c !== null && (b > c && (w = L.cloneElement(g, {
|
|
514
|
+
className: H(
|
|
515
|
+
y,
|
|
516
|
+
(v = g == null ? void 0 : g.props) == null ? void 0 : v.className
|
|
517
|
+
)
|
|
518
|
+
})), b === c + 1)) {
|
|
519
|
+
const m = L.Children.toArray(o).slice(c + 1).map(
|
|
520
|
+
(x) => L.cloneElement(x, {
|
|
521
|
+
key: x.props._key
|
|
516
522
|
})
|
|
517
523
|
);
|
|
518
|
-
t =
|
|
524
|
+
t = S(m);
|
|
519
525
|
}
|
|
520
|
-
return
|
|
526
|
+
return w;
|
|
521
527
|
}) ?? [];
|
|
522
|
-
return [
|
|
528
|
+
return [f, ...d, t];
|
|
523
529
|
};
|
|
524
530
|
return Z(() => {
|
|
525
531
|
let t;
|
|
526
532
|
return n.current && (t = new ResizeObserver(a), t.observe(n.current)), () => {
|
|
527
|
-
var
|
|
528
|
-
n.current && ((
|
|
533
|
+
var f, d;
|
|
534
|
+
n.current && ((f = t == null ? void 0 : t.unobserve) == null || f.call(t, n.current)), (d = t == null ? void 0 : t.disconnect) == null || d.call(t), t = null;
|
|
529
535
|
};
|
|
530
|
-
}, [n.current]), /* @__PURE__ */ i("div", { className: `${r}-overflow-wrap`, ref: n, children:
|
|
536
|
+
}, [n.current]), /* @__PURE__ */ i("div", { className: `${r}-overflow-wrap`, ref: n, children: E() });
|
|
531
537
|
}, hn = "light", yn = {
|
|
532
538
|
mode: "vertical",
|
|
533
539
|
selectable: !0,
|
|
534
540
|
ellipsis: !0
|
|
535
541
|
};
|
|
536
542
|
function gn(l, o) {
|
|
537
|
-
const { getPrefixCls: e, componentConfig: s, rtl: r } = K(
|
|
543
|
+
const { getPrefixCls: e, componentConfig: s, rtl: r } = K(Ie), n = Ge(
|
|
538
544
|
l,
|
|
539
545
|
yn,
|
|
540
546
|
s == null ? void 0 : s.Menu
|
|
@@ -544,64 +550,64 @@ function gn(l, o) {
|
|
|
544
550
|
className: h,
|
|
545
551
|
prefixCls: y,
|
|
546
552
|
mode: p,
|
|
547
|
-
theme:
|
|
553
|
+
theme: C,
|
|
548
554
|
icons: a,
|
|
549
|
-
levelIndent:
|
|
550
|
-
collapse:
|
|
555
|
+
levelIndent: S,
|
|
556
|
+
collapse: E,
|
|
551
557
|
inDropdown: t,
|
|
552
|
-
selectable:
|
|
558
|
+
selectable: f,
|
|
553
559
|
triggerProps: d,
|
|
554
|
-
tooltipProps:
|
|
555
|
-
ellipsis:
|
|
556
|
-
accordion:
|
|
557
|
-
autoOpen:
|
|
558
|
-
autoScrollIntoView:
|
|
559
|
-
scrollConfig:
|
|
560
|
-
hasCollapseButton:
|
|
560
|
+
tooltipProps: g,
|
|
561
|
+
ellipsis: b,
|
|
562
|
+
accordion: w,
|
|
563
|
+
autoOpen: v,
|
|
564
|
+
autoScrollIntoView: m,
|
|
565
|
+
scrollConfig: x,
|
|
566
|
+
hasCollapseButton: P,
|
|
561
567
|
defaultOpenKeys: O,
|
|
562
|
-
defaultSelectedKeys:
|
|
568
|
+
defaultSelectedKeys: $,
|
|
563
569
|
openKeys: A,
|
|
564
|
-
selectedKeys:
|
|
570
|
+
selectedKeys: I,
|
|
565
571
|
onClickSubMenu: k,
|
|
566
572
|
onClickMenuItem: V,
|
|
567
573
|
onCollapseChange: G,
|
|
568
574
|
onEllipsisChange: q,
|
|
569
575
|
..._
|
|
570
|
-
} = n, [
|
|
576
|
+
} = n, [N, ue] = re([], {
|
|
571
577
|
defaultValue: O,
|
|
572
578
|
value: A
|
|
573
579
|
}), [Pe, $e] = re([], {
|
|
574
|
-
defaultValue:
|
|
575
|
-
value:
|
|
580
|
+
defaultValue: $,
|
|
581
|
+
value: I
|
|
576
582
|
}), [Q, Ee] = re(!1, {
|
|
577
|
-
value:
|
|
578
|
-
}), Te = K(
|
|
583
|
+
value: E
|
|
584
|
+
}), Te = K(B), { siderCollapsed: Oe } = K(ze), R = y || e("menu"), Y = Oe || Q || t || p === "popButton", pe = C || Te.theme || hn, W = J([]), de = J([]), _e = Ve(), Re = We(), fe = Fe(() => ke(u), [u]), De = le(`${R}-`), oe = _.id || De;
|
|
579
585
|
Z(() => {
|
|
580
|
-
let
|
|
586
|
+
let M = N.filter(
|
|
581
587
|
(T) => W.current.indexOf(T) !== -1
|
|
582
588
|
);
|
|
583
|
-
if (
|
|
589
|
+
if (v) {
|
|
584
590
|
const T = W.current.filter(
|
|
585
591
|
(D) => de.current.indexOf(D) === -1
|
|
586
592
|
);
|
|
587
|
-
|
|
593
|
+
M = N.concat(T);
|
|
588
594
|
}
|
|
589
|
-
ue(
|
|
595
|
+
ue(w ? M.slice(0, 1) : M), de.current = W.current.slice();
|
|
590
596
|
}, [W.current.toString()]);
|
|
591
|
-
const me = p !== "horizontal" && p !== "popButton" && !t &&
|
|
592
|
-
const
|
|
597
|
+
const me = p !== "horizontal" && p !== "popButton" && !t && P, Ke = () => {
|
|
598
|
+
const M = ne(u, { level: 1 }), T = Q ? a && a.collapseActive || /* @__PURE__ */ i(Ue, {}) : a && a.collapseDefault || /* @__PURE__ */ i(Ae, {}), D = () => {
|
|
593
599
|
const U = !Q;
|
|
594
600
|
Ee(U), G == null || G(U);
|
|
595
601
|
};
|
|
596
|
-
return /* @__PURE__ */ F(
|
|
597
|
-
/* @__PURE__ */ i("div", { className: `${R}-inner`, children: p === "horizontal" &&
|
|
602
|
+
return /* @__PURE__ */ F(we, { children: [
|
|
603
|
+
/* @__PURE__ */ i("div", { className: `${R}-inner`, children: p === "horizontal" && b !== !1 ? /* @__PURE__ */ i(
|
|
598
604
|
mn,
|
|
599
605
|
{
|
|
600
|
-
ellipsisText: He(
|
|
606
|
+
ellipsisText: He(b) ? b.text : "···",
|
|
601
607
|
onEllipsisChange: q,
|
|
602
|
-
children:
|
|
608
|
+
children: M
|
|
603
609
|
}
|
|
604
|
-
) :
|
|
610
|
+
) : M }),
|
|
605
611
|
me && /* @__PURE__ */ i(
|
|
606
612
|
"div",
|
|
607
613
|
{
|
|
@@ -625,7 +631,7 @@ function gn(l, o) {
|
|
|
625
631
|
...z(_, ["isMenu"]),
|
|
626
632
|
ref: o,
|
|
627
633
|
style: he,
|
|
628
|
-
className:
|
|
634
|
+
className: H(
|
|
629
635
|
R,
|
|
630
636
|
`${R}-${pe}`,
|
|
631
637
|
`${R}-${p === "horizontal" ? "horizontal" : "vertical"}`,
|
|
@@ -639,37 +645,37 @@ function gn(l, o) {
|
|
|
639
645
|
h
|
|
640
646
|
),
|
|
641
647
|
children: /* @__PURE__ */ i(
|
|
642
|
-
|
|
648
|
+
B.Provider,
|
|
643
649
|
{
|
|
644
650
|
value: {
|
|
645
651
|
mode: p,
|
|
646
652
|
theme: pe,
|
|
647
653
|
collapse: Y,
|
|
648
|
-
levelIndent:
|
|
654
|
+
levelIndent: S,
|
|
649
655
|
inDropdown: t,
|
|
650
656
|
selectedKeys: Pe,
|
|
651
|
-
openKeys:
|
|
657
|
+
openKeys: N,
|
|
652
658
|
icons: a,
|
|
653
659
|
triggerProps: d,
|
|
654
|
-
tooltipProps:
|
|
655
|
-
autoScrollIntoView:
|
|
656
|
-
scrollConfig:
|
|
660
|
+
tooltipProps: g,
|
|
661
|
+
autoScrollIntoView: m,
|
|
662
|
+
scrollConfig: x,
|
|
657
663
|
// pass props directly
|
|
658
664
|
id: oe,
|
|
659
665
|
prefixCls: R,
|
|
660
|
-
collectInlineMenuKeys: (
|
|
666
|
+
collectInlineMenuKeys: (M, T) => {
|
|
661
667
|
T ? W.current = W.current.filter(
|
|
662
|
-
(D) => D !==
|
|
663
|
-
) : W.current.push(
|
|
668
|
+
(D) => D !== M
|
|
669
|
+
) : W.current.push(M), _e();
|
|
664
670
|
},
|
|
665
|
-
onClickMenuItem: (
|
|
671
|
+
onClickMenuItem: (M, T) => {
|
|
666
672
|
var D;
|
|
667
|
-
|
|
673
|
+
f && $e([M]), V == null || V(M, T, (D = fe[M]) == null ? void 0 : D.keyPath);
|
|
668
674
|
},
|
|
669
|
-
onClickSubMenu: (
|
|
675
|
+
onClickSubMenu: (M, T, D) => {
|
|
670
676
|
var ye;
|
|
671
|
-
let U = [...
|
|
672
|
-
D === "inline" && ((
|
|
677
|
+
let U = [...N];
|
|
678
|
+
D === "inline" && ((N == null ? void 0 : N.indexOf(M)) > -1 ? w && T === 1 ? U = [] : U = N.filter((Le) => Le !== M) : w && T === 1 ? U = [M] : U = N.concat([M])), ue(U), k == null || k(M, U, (ye = fe[M]) == null ? void 0 : ye.keyPath);
|
|
673
679
|
}
|
|
674
680
|
},
|
|
675
681
|
children: Ke()
|