@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,7 +1,7 @@
|
|
|
1
1
|
import { jsx as $, jsxs as Q, Fragment as Te } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as j, useEffect as X, useCallback as V, createContext as Ce, useContext as ie } from "react";
|
|
3
3
|
import se from "../Button.js";
|
|
4
|
-
import { d as He } from "./
|
|
4
|
+
import { d as He } from "./C5S_amaH.js";
|
|
5
5
|
import { y as ee } from "./BzPkh4Zv.js";
|
|
6
6
|
import { dayjs as g, methods as Y, getDayjsValue as Oe, getNow as re, toLocal as ce } from "../utils/dayjs.js";
|
|
7
7
|
import { padStart as C } from "../utils/pad.js";
|
|
@@ -2,27 +2,28 @@ import { jsx as h, jsxs as et } from "react/jsx-runtime";
|
|
|
2
2
|
import ft from "lodash/isFunction";
|
|
3
3
|
import kt from "lodash/isPlainObject";
|
|
4
4
|
import F, { useContext as nt, useRef as j, useState as wt, useEffect as Y, useMemo as at, useCallback as ce, useImperativeHandle as le } from "react";
|
|
5
|
-
import { d as mt, I as pt } from "./
|
|
5
|
+
import { d as mt, I as pt } from "./C5S_amaH.js";
|
|
6
6
|
import { useId as se } from "../hooks/useId.js";
|
|
7
7
|
import { useMergeProps as fe } from "../hooks/useMergeProps.js";
|
|
8
8
|
import { useMergeValue as de } from "../hooks/useMergeValue.js";
|
|
9
9
|
import { y as M } from "./BzPkh4Zv.js";
|
|
10
10
|
import dt from "../utils/omit.js";
|
|
11
|
-
import
|
|
11
|
+
import ue from "@unicom-cloud/icons/IconUiPlus";
|
|
12
12
|
import Tt from "lodash/isNumber";
|
|
13
13
|
import he from "lodash/throttle";
|
|
14
14
|
import { on as st, off as At } from "../utils/dom.js";
|
|
15
15
|
import { E as Yt } from "./C2lIz2F9.js";
|
|
16
16
|
import { setTransformStyle as me } from "../utils/style.js";
|
|
17
|
-
import
|
|
17
|
+
import jt from "@unicom-cloud/icons/IconUiDown";
|
|
18
18
|
import Ut from "lodash/isNull";
|
|
19
19
|
import pe from "../Dropdown.js";
|
|
20
|
-
import { M as Mt } from "./
|
|
20
|
+
import { M as Mt } from "./JpKOcIfl.js";
|
|
21
21
|
import ge from "lodash/isEqualWith";
|
|
22
22
|
import be from "../utils/throttleByRaf.js";
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
23
|
+
import Et from "@unicom-cloud/icons/IconUiLeft";
|
|
24
|
+
import Bt from "@unicom-cloud/icons/IconUiRight";
|
|
25
|
+
import ve from "@unicom-cloud/icons/IconUiUp";
|
|
26
|
+
import ye from "@unicom-cloud/icons/IconUiClose";
|
|
26
27
|
function $e(e) {
|
|
27
28
|
const {
|
|
28
29
|
animation: r,
|
|
@@ -32,7 +33,7 @@ function $e(e) {
|
|
|
32
33
|
direction: s,
|
|
33
34
|
lazyload: i,
|
|
34
35
|
destroyOnHide: $
|
|
35
|
-
} = e, m = a.findIndex((l) => l.key === o), v = nt(
|
|
36
|
+
} = e, m = a.findIndex((l) => l.key === o), v = nt(Rt), { rtl: w } = nt(mt);
|
|
36
37
|
if (a.every((l) => (l == null ? void 0 : l.props) && (!("children" in l.props) || l.props.children === null)))
|
|
37
38
|
return null;
|
|
38
39
|
const f = M(`${n}-content-inner`, {
|
|
@@ -114,9 +115,9 @@ function we(e) {
|
|
|
114
115
|
if (!a) return;
|
|
115
116
|
d.preventDefault();
|
|
116
117
|
const { deltaX: c, deltaY: T } = d;
|
|
117
|
-
let
|
|
118
|
+
let I = 0;
|
|
118
119
|
const N = Math.abs(c), P = Math.abs(T);
|
|
119
|
-
N === P ?
|
|
120
|
+
N === P ? I = m.current === "x" ? c : T : N > P ? (I = c, m.current = "x") : (I = T, m.current = "y"), $(I, I);
|
|
120
121
|
}
|
|
121
122
|
const w = j({
|
|
122
123
|
clientX: 0,
|
|
@@ -125,7 +126,7 @@ function we(e) {
|
|
|
125
126
|
d.cancelable && d.preventDefault();
|
|
126
127
|
const c = f(d);
|
|
127
128
|
if (!c) return;
|
|
128
|
-
const { clientX: T, clientY:
|
|
129
|
+
const { clientX: T, clientY: I } = w.current, N = c.clientX - T, P = c.clientY - I;
|
|
129
130
|
$(-N, -P);
|
|
130
131
|
}, x = () => {
|
|
131
132
|
At(document.documentElement, "touchmove", l), At(document.documentElement, "touchend", x);
|
|
@@ -285,7 +286,7 @@ const Ce = (e, r, o) => {
|
|
|
285
286
|
}, Pe = {
|
|
286
287
|
prev: "left",
|
|
287
288
|
next: "right"
|
|
288
|
-
},
|
|
289
|
+
}, Re = {
|
|
289
290
|
prev: "up",
|
|
290
291
|
next: "down"
|
|
291
292
|
}, Lt = (e) => {
|
|
@@ -302,8 +303,8 @@ const Ce = (e, r, o) => {
|
|
|
302
303
|
} = e, { height: w, width: f } = n, { height: l, width: x } = o, u = l - w, y = x - f, d = {
|
|
303
304
|
up: /* @__PURE__ */ h(ve, {}),
|
|
304
305
|
down: /* @__PURE__ */ h(jt, {}),
|
|
305
|
-
left: m ? /* @__PURE__ */ h(
|
|
306
|
-
right: m ? /* @__PURE__ */ h(
|
|
306
|
+
left: m ? /* @__PURE__ */ h(Bt, {}) : /* @__PURE__ */ h(Et, {}),
|
|
307
|
+
right: m ? /* @__PURE__ */ h(Et, {}) : /* @__PURE__ */ h(Bt, {})
|
|
307
308
|
}, c = (H) => {
|
|
308
309
|
var p;
|
|
309
310
|
H !== e.currentOffset && ((p = e == null ? void 0 : e.onChange) == null || p.call(e, H));
|
|
@@ -311,7 +312,7 @@ const Ce = (e, r, o) => {
|
|
|
311
312
|
H.preventDefault();
|
|
312
313
|
let C;
|
|
313
314
|
$ === "left" ? C = p === "left" ? i - f : i + f : C = p === "left" ? i + f : i - f, c(C);
|
|
314
|
-
},
|
|
315
|
+
}, I = (H, p) => {
|
|
315
316
|
H.preventDefault();
|
|
316
317
|
let C;
|
|
317
318
|
if (p === "up")
|
|
@@ -321,9 +322,9 @@ const Ce = (e, r, o) => {
|
|
|
321
322
|
}, N = at(() => $ === "left" ? i <= 0 : r === "vertical" ? i >= u : i >= y, [$, r, i, y, i]), P = at(() => $ === "left" ? r === "vertical" ? i >= u : i >= y : i <= 0, [$, r, u, y, i]);
|
|
322
323
|
if (Ut(v))
|
|
323
324
|
return null;
|
|
324
|
-
const E = r === "horizontal" ? Pe[s] :
|
|
325
|
+
const E = r === "horizontal" ? Pe[s] : Re[s], K = s === "prev" ? N : P, _ = M(`${a}-${E}-icon`, {
|
|
325
326
|
[`${a}-nav-icon-disabled`]: K
|
|
326
|
-
}), U = r === "vertical" ?
|
|
327
|
+
}), U = r === "vertical" ? I : T;
|
|
327
328
|
return /* @__PURE__ */ h(
|
|
328
329
|
pt,
|
|
329
330
|
{
|
|
@@ -334,7 +335,7 @@ const Ce = (e, r, o) => {
|
|
|
334
335
|
children: v || d[E]
|
|
335
336
|
}
|
|
336
337
|
);
|
|
337
|
-
},
|
|
338
|
+
}, Ie = ({
|
|
338
339
|
prefixCls: e,
|
|
339
340
|
onDeleteTab: r,
|
|
340
341
|
tabKey: o,
|
|
@@ -400,7 +401,7 @@ const Ce = (e, r, o) => {
|
|
|
400
401
|
editable: $
|
|
401
402
|
}
|
|
402
403
|
);
|
|
403
|
-
}, Ne = F.forwardRef(
|
|
404
|
+
}, Ne = F.forwardRef(Ie), Pt = "vertical", ut = "right", ht = "left", Xt = {
|
|
404
405
|
delete: !0,
|
|
405
406
|
add: !0
|
|
406
407
|
}, He = ({
|
|
@@ -419,7 +420,7 @@ const Ce = (e, r, o) => {
|
|
|
419
420
|
const a = St(o, n);
|
|
420
421
|
return e === Pt ? -a.top : r === ut ? a.right : -a.left;
|
|
421
422
|
}, xt = F.forwardRef((e, r) => {
|
|
422
|
-
const o = nt(
|
|
423
|
+
const o = nt(Rt), { rtl: n } = nt(mt), a = { ...e, ...o }, [s, i, $] = it(), [m, v, w] = it(), [f, l, x] = it(), [u, y, d] = it(), [c, T, I] = it(), N = j({}), [P, E] = wt(0), [K, _] = wt(!0), {
|
|
423
424
|
paneChildren: U,
|
|
424
425
|
editable: H,
|
|
425
426
|
prefixCls: p,
|
|
@@ -433,9 +434,9 @@ const Ce = (e, r, o) => {
|
|
|
433
434
|
style: Ft,
|
|
434
435
|
tabPosition: Gt,
|
|
435
436
|
className: qt,
|
|
436
|
-
extra:
|
|
437
|
+
extra: It,
|
|
437
438
|
animation: Jt,
|
|
438
|
-
icons:
|
|
439
|
+
icons: R,
|
|
439
440
|
deleteButton: Qt,
|
|
440
441
|
addButton: Zt,
|
|
441
442
|
renderTabTitle: te,
|
|
@@ -467,7 +468,7 @@ const Ce = (e, r, o) => {
|
|
|
467
468
|
width: b.offsetWidth,
|
|
468
469
|
domRect: b.getBoundingClientRect()
|
|
469
470
|
});
|
|
470
|
-
}, 200), q = ct($), J = ct(w), Q = ct(d), Z = ct(
|
|
471
|
+
}, 200), q = ct($), J = ct(w), Q = ct(d), Z = ct(I), gt = ce(
|
|
471
472
|
(t) => {
|
|
472
473
|
const g = S === Pt ? v.height - i.height : v.width - i.width;
|
|
473
474
|
let b = t;
|
|
@@ -567,7 +568,7 @@ const Ce = (e, r, o) => {
|
|
|
567
568
|
ref: c,
|
|
568
569
|
onClick: Dt,
|
|
569
570
|
...zt({ onPressEnter: Dt }),
|
|
570
|
-
children: Zt || /* @__PURE__ */ h(pt, { prefix: `${p}-add`, children: /* @__PURE__ */ h("span", { className: `${p}-add`, children: (
|
|
571
|
+
children: Zt || /* @__PURE__ */ h(pt, { prefix: `${p}-add`, children: /* @__PURE__ */ h("span", { className: `${p}-add`, children: (R == null ? void 0 : R.add) || /* @__PURE__ */ h(ue, {}) }) })
|
|
571
572
|
}
|
|
572
573
|
);
|
|
573
574
|
return we({
|
|
@@ -608,7 +609,7 @@ const Ce = (e, r, o) => {
|
|
|
608
609
|
{
|
|
609
610
|
iconPos: "prev",
|
|
610
611
|
rtl: n,
|
|
611
|
-
icon:
|
|
612
|
+
icon: R == null ? void 0 : R.prev,
|
|
612
613
|
prefixCls: p,
|
|
613
614
|
currentOffset: P,
|
|
614
615
|
headerSize: v,
|
|
@@ -645,7 +646,7 @@ const Ce = (e, r, o) => {
|
|
|
645
646
|
},
|
|
646
647
|
isActive: ot === t.key,
|
|
647
648
|
editable: lt && t.props.closable !== !1,
|
|
648
|
-
deleteIcon:
|
|
649
|
+
deleteIcon: R == null ? void 0 : R.delete,
|
|
649
650
|
deleteButton: Qt,
|
|
650
651
|
getIdPrefix: o.getIdPrefix,
|
|
651
652
|
index: g
|
|
@@ -678,7 +679,7 @@ const Ce = (e, r, o) => {
|
|
|
678
679
|
prefixCls: p,
|
|
679
680
|
rtl: n,
|
|
680
681
|
iconPos: "next",
|
|
681
|
-
icon:
|
|
682
|
+
icon: R == null ? void 0 : R.next,
|
|
682
683
|
currentOffset: P,
|
|
683
684
|
headerSize: v,
|
|
684
685
|
headerWrapperSize: i,
|
|
@@ -695,15 +696,15 @@ const Ce = (e, r, o) => {
|
|
|
695
696
|
prefixCls: p,
|
|
696
697
|
currentOffset: P,
|
|
697
698
|
headerSize: v,
|
|
698
|
-
icon:
|
|
699
|
+
icon: R == null ? void 0 : R.dropdown,
|
|
699
700
|
headerWrapperSize: i,
|
|
700
701
|
getTitleRef: (t) => N.current[t],
|
|
701
702
|
direction: S
|
|
702
703
|
}
|
|
703
704
|
),
|
|
704
|
-
(lt && z ||
|
|
705
|
+
(lt && z || It) && /* @__PURE__ */ et("div", { className: `${p}-header-extra`, ref: u, children: [
|
|
705
706
|
z && Ot(lt),
|
|
706
|
-
|
|
707
|
+
It
|
|
707
708
|
] })
|
|
708
709
|
]
|
|
709
710
|
}
|
|
@@ -728,7 +729,7 @@ const Oe = ["mini", "small", "default", "large"], We = (e) => {
|
|
|
728
729
|
lazyload: !0,
|
|
729
730
|
headerPadding: !0,
|
|
730
731
|
scrollPosition: "auto"
|
|
731
|
-
},
|
|
732
|
+
}, Rt = F.createContext({});
|
|
732
733
|
function Ee(e, r) {
|
|
733
734
|
const {
|
|
734
735
|
getPrefixCls: o,
|
|
@@ -752,7 +753,7 @@ function Ee(e, r) {
|
|
|
752
753
|
style: d,
|
|
753
754
|
type: c,
|
|
754
755
|
justify: T,
|
|
755
|
-
destroyOnHide:
|
|
756
|
+
destroyOnHide: I,
|
|
756
757
|
lazyload: N,
|
|
757
758
|
headerSticky: P,
|
|
758
759
|
// 潘启宝添加
|
|
@@ -782,7 +783,7 @@ function Ee(e, r) {
|
|
|
782
783
|
activeTab: v,
|
|
783
784
|
paneChildren: $,
|
|
784
785
|
prefixCls: f,
|
|
785
|
-
destroyOnHide:
|
|
786
|
+
destroyOnHide: I,
|
|
786
787
|
lazyload: N
|
|
787
788
|
}
|
|
788
789
|
);
|
|
@@ -826,7 +827,7 @@ function Ee(e, r) {
|
|
|
826
827
|
),
|
|
827
828
|
ref: m,
|
|
828
829
|
children: /* @__PURE__ */ et(
|
|
829
|
-
|
|
830
|
+
Rt.Provider,
|
|
830
831
|
{
|
|
831
832
|
value: {
|
|
832
833
|
...S,
|
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
import { jsx as i, jsxs as A, Fragment as Ue } from "react/jsx-runtime";
|
|
2
|
+
import Ge from "@unicom-cloud/icons/IconUiClose";
|
|
3
|
+
import { P as Ie, _ as Ke } from "./CLBavO5c.js";
|
|
4
|
+
import $e from "lodash/isArray";
|
|
5
|
+
import Ce, { useContext as qe, useRef as $, useState as Xe, useImperativeHandle as Ye, useMemo as Je, useEffect as Qe } from "react";
|
|
6
|
+
import { d as Ze, I as et } from "./C5S_amaH.js";
|
|
7
|
+
import tt from "../Draggable.js";
|
|
8
|
+
import { useMergeProps as ot } from "../hooks/useMergeProps.js";
|
|
9
|
+
import { useMergeValue as be } from "../hooks/useMergeValue.js";
|
|
10
|
+
import { I as at } from "./DXZ8-ha7.js";
|
|
11
|
+
import rt from "../OverflowEllipsis.js";
|
|
12
|
+
import nt from "../Popover.js";
|
|
13
|
+
import st from "../Tag.js";
|
|
14
|
+
import { y as M } from "./BzPkh4Zv.js";
|
|
15
|
+
import lt from "../utils/fillNBSP.js";
|
|
16
|
+
import ct from "../utils/getHotkeyHandler.js";
|
|
17
|
+
import "../utils/is.js";
|
|
18
|
+
import { B as it } from "./C2lIz2F9.js";
|
|
19
|
+
import ut from "../utils/omit.js";
|
|
20
|
+
import Pe from "lodash/isPlainObject";
|
|
21
|
+
const X = 300, pt = "responsive", ft = `__input_${Math.random().toFixed(10).slice(2)}`, T = (s) => s == null, _ = (s) => {
|
|
22
|
+
s.target.tagName !== "INPUT" && s.preventDefault();
|
|
23
|
+
}, Ne = (s) => $e(s) ? s.map((c) => Pe(c) ? {
|
|
24
|
+
...c,
|
|
25
|
+
label: "label" in c ? c.label : c.value,
|
|
26
|
+
value: c.value,
|
|
27
|
+
closable: c.closable
|
|
28
|
+
} : {
|
|
29
|
+
label: c,
|
|
30
|
+
value: c
|
|
31
|
+
}) : [], dt = (s) => {
|
|
32
|
+
const c = $(0), d = $(s.length);
|
|
33
|
+
return Qe(() => {
|
|
34
|
+
c.current = s.length === 0 && d.current > 0 ? X : 0, d.current = s.length;
|
|
35
|
+
}, [s]), c;
|
|
36
|
+
}, Te = ({
|
|
37
|
+
prefixCls: s,
|
|
38
|
+
children: c,
|
|
39
|
+
animation: d
|
|
40
|
+
}) => /* @__PURE__ */ i("div", { className: `${s}-inner`, children: d ? /* @__PURE__ */ i(Ke, { component: null, children: c }) : c }), mt = {
|
|
41
|
+
animation: !0,
|
|
42
|
+
validate: (s, c) => s && c.every((d) => d.value !== s)
|
|
43
|
+
};
|
|
44
|
+
function gt(s, c) {
|
|
45
|
+
const {
|
|
46
|
+
getPrefixCls: d,
|
|
47
|
+
size: Ve,
|
|
48
|
+
componentConfig: E,
|
|
49
|
+
rtl: Y
|
|
50
|
+
} = qe(Ze), f = ot(
|
|
51
|
+
s,
|
|
52
|
+
mt,
|
|
53
|
+
E == null ? void 0 : E.InputTag
|
|
54
|
+
), {
|
|
55
|
+
className: we,
|
|
56
|
+
style: Se,
|
|
57
|
+
placeholder: De,
|
|
58
|
+
error: Re,
|
|
59
|
+
disabled: h,
|
|
60
|
+
readOnly: g,
|
|
61
|
+
allowClear: Ae,
|
|
62
|
+
autoFocus: Me,
|
|
63
|
+
labelInValue: _e,
|
|
64
|
+
disableInput: Ee,
|
|
65
|
+
animation: J,
|
|
66
|
+
saveOnBlur: ke,
|
|
67
|
+
dragToSort: ze,
|
|
68
|
+
icon: y,
|
|
69
|
+
prefix: Q,
|
|
70
|
+
suffix: Z,
|
|
71
|
+
addBefore: ee,
|
|
72
|
+
addAfter: te,
|
|
73
|
+
tokenSeparators: k,
|
|
74
|
+
validate: C,
|
|
75
|
+
renderTag: oe,
|
|
76
|
+
tagClassName: ae,
|
|
77
|
+
maxTagCount: m,
|
|
78
|
+
onInputChange: z,
|
|
79
|
+
onKeyDown: x,
|
|
80
|
+
onPaste: O,
|
|
81
|
+
onChange: F,
|
|
82
|
+
onFocus: j,
|
|
83
|
+
onBlur: H,
|
|
84
|
+
onPressEnter: W,
|
|
85
|
+
onRemove: B,
|
|
86
|
+
onClear: L,
|
|
87
|
+
onClick: re,
|
|
88
|
+
...xe
|
|
89
|
+
} = f, o = d("input-tag"), P = "size" in f ? f.size : Ve, V = typeof m == "object" ? m.count : m, I = $(), U = $(null), G = $(), [w, ne] = Xe(!1), [a, Oe] = be([], {
|
|
90
|
+
defaultValue: "defaultValue" in f ? Ne(f.defaultValue) : void 0,
|
|
91
|
+
value: "value" in f ? Ne(f.value) : void 0
|
|
92
|
+
}), [b, S] = be("", {
|
|
93
|
+
value: f.inputValue
|
|
94
|
+
}), Fe = dt(a), je = !!(ze && !g && !h);
|
|
95
|
+
Ye(c, () => {
|
|
96
|
+
var e, t;
|
|
97
|
+
return {
|
|
98
|
+
blur: (e = I.current) == null ? void 0 : e.blur,
|
|
99
|
+
focus: (t = I.current) == null ? void 0 : t.focus,
|
|
100
|
+
getRootDOMNode: () => G.current
|
|
101
|
+
};
|
|
102
|
+
}, []);
|
|
103
|
+
const N = (e, t) => {
|
|
104
|
+
h || g || ("value" in f || Oe(e), F == null || F(_e ? e : e.map((r) => r == null ? void 0 : r.value), t));
|
|
105
|
+
}, se = (e, t, r) => {
|
|
106
|
+
B == null || B(e, t, r), N(
|
|
107
|
+
[...a.slice(0, t), ...a.slice(t + 1)],
|
|
108
|
+
"remove"
|
|
109
|
+
);
|
|
110
|
+
}, He = ct(
|
|
111
|
+
/* @__PURE__ */ new Map([
|
|
112
|
+
[
|
|
113
|
+
it.key,
|
|
114
|
+
(e) => {
|
|
115
|
+
if (!e.target.value && a.length)
|
|
116
|
+
for (let t = a.length - 1; t >= 0; t--) {
|
|
117
|
+
const r = a[t];
|
|
118
|
+
if (r.closable !== !1) {
|
|
119
|
+
se(r, t, e);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
])
|
|
126
|
+
), le = async () => {
|
|
127
|
+
try {
|
|
128
|
+
const e = typeof C == "function" ? await C(b, a) : !0;
|
|
129
|
+
e && (N(
|
|
130
|
+
a.concat({
|
|
131
|
+
value: e === !0 ? b : e,
|
|
132
|
+
label: b
|
|
133
|
+
}),
|
|
134
|
+
"add"
|
|
135
|
+
), S(""));
|
|
136
|
+
} catch (e) {
|
|
137
|
+
console.error(e);
|
|
138
|
+
}
|
|
139
|
+
}, ce = (e, t, r = !1) => {
|
|
140
|
+
const n = e.value;
|
|
141
|
+
let l = e.label, u = !g && !h && e.closable !== !1;
|
|
142
|
+
const p = typeof n == "object" ? t : n, v = (Le) => {
|
|
143
|
+
se(e, t, Le);
|
|
144
|
+
};
|
|
145
|
+
if (!r && typeof V == "number" && t >= V)
|
|
146
|
+
return t === a.length - 1 ? (l = ie(a.length - Number(V)), u = !1, { valueKey: p, dom: l }) : { valueKey: p, dom: null };
|
|
147
|
+
if (oe)
|
|
148
|
+
return {
|
|
149
|
+
valueKey: p,
|
|
150
|
+
dom: oe(
|
|
151
|
+
{
|
|
152
|
+
value: n,
|
|
153
|
+
label: l,
|
|
154
|
+
closable: u,
|
|
155
|
+
onClose: v
|
|
156
|
+
},
|
|
157
|
+
t,
|
|
158
|
+
a
|
|
159
|
+
)
|
|
160
|
+
};
|
|
161
|
+
const Be = {
|
|
162
|
+
closable: u,
|
|
163
|
+
onClose: v,
|
|
164
|
+
visible: !0,
|
|
165
|
+
children: lt(l),
|
|
166
|
+
closeIcon: y == null ? void 0 : y.removeIcon,
|
|
167
|
+
__closeIconProps: {
|
|
168
|
+
onMouseDown: _
|
|
169
|
+
},
|
|
170
|
+
className: M(`${o}-tag`, {
|
|
171
|
+
[ae]: ae
|
|
172
|
+
}),
|
|
173
|
+
title: typeof l == "string" ? l : void 0
|
|
174
|
+
};
|
|
175
|
+
return { valueKey: p, dom: /* @__PURE__ */ i(st, { ...Be }, `${p}-tag`) };
|
|
176
|
+
};
|
|
177
|
+
function ie(e) {
|
|
178
|
+
const t = typeof m == "object" && m.render ? m.render : () => /* @__PURE__ */ A("span", { className: `${o}-tag-ellipsis`, children: [
|
|
179
|
+
"+",
|
|
180
|
+
e
|
|
181
|
+
] }), r = Pe(m) && m.popoverProps;
|
|
182
|
+
return /* @__PURE__ */ i(
|
|
183
|
+
nt,
|
|
184
|
+
{
|
|
185
|
+
content: /* @__PURE__ */ i(Ue, { children: a.map((n, l) => ({ tagValue: n, tagIndex: l })).slice(-e).map(
|
|
186
|
+
({ tagValue: n, tagIndex: l }) => {
|
|
187
|
+
var u;
|
|
188
|
+
return (u = ce(n, l, !0)) == null ? void 0 : u.dom;
|
|
189
|
+
}
|
|
190
|
+
) }),
|
|
191
|
+
...r || {},
|
|
192
|
+
children: t(e, a)
|
|
193
|
+
}
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
const ue = async (e) => {
|
|
197
|
+
if (U.current = null, $e(k) && k.length) {
|
|
198
|
+
const t = e.split(
|
|
199
|
+
new RegExp(`[${k.join("")}]`)
|
|
200
|
+
);
|
|
201
|
+
if (t.length > 1) {
|
|
202
|
+
U.current = Date.now();
|
|
203
|
+
const r = [];
|
|
204
|
+
await Promise.all(
|
|
205
|
+
t.map(async (n) => {
|
|
206
|
+
const l = n ? typeof C == "function" ? await C(n, a) : !0 : !1;
|
|
207
|
+
l && r.push({
|
|
208
|
+
value: l === !0 ? n : l,
|
|
209
|
+
label: n
|
|
210
|
+
});
|
|
211
|
+
})
|
|
212
|
+
), r.length && N(a.concat(r), "add");
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}, pe = Ae && !h && !g && a.length ? /* @__PURE__ */ i(
|
|
216
|
+
et,
|
|
217
|
+
{
|
|
218
|
+
size: P,
|
|
219
|
+
className: `${o}-clear-icon`,
|
|
220
|
+
onClick: (e) => {
|
|
221
|
+
var t;
|
|
222
|
+
e.stopPropagation(), N([], "clear"), w || (t = I.current) == null || t.focus(), L == null || L();
|
|
223
|
+
},
|
|
224
|
+
children: y && y.clearIcon || /* @__PURE__ */ i(Ge, {})
|
|
225
|
+
},
|
|
226
|
+
"clearIcon"
|
|
227
|
+
) : null, fe = h || Ee, K = Je(() => {
|
|
228
|
+
const e = {};
|
|
229
|
+
return a.map((r, n) => {
|
|
230
|
+
const l = e[r.value] || 0, u = l >= 1;
|
|
231
|
+
e[r.value] = l + 1;
|
|
232
|
+
const { dom: p, valueKey: v } = ce(r, n);
|
|
233
|
+
return Ce.isValidElement(p) ? /* @__PURE__ */ i(
|
|
234
|
+
Ie,
|
|
235
|
+
{
|
|
236
|
+
timeout: X,
|
|
237
|
+
classNames: "zoomIn",
|
|
238
|
+
children: p
|
|
239
|
+
},
|
|
240
|
+
u ? `${v}-${n}` : v
|
|
241
|
+
) : p;
|
|
242
|
+
});
|
|
243
|
+
}, [a]), q = [
|
|
244
|
+
/* @__PURE__ */ i(
|
|
245
|
+
Ie,
|
|
246
|
+
{
|
|
247
|
+
timeout: X,
|
|
248
|
+
classNames: "zoomIn",
|
|
249
|
+
children: /* @__PURE__ */ i(
|
|
250
|
+
at,
|
|
251
|
+
{
|
|
252
|
+
autoComplete: "off",
|
|
253
|
+
size: P,
|
|
254
|
+
disabled: fe,
|
|
255
|
+
readOnly: g,
|
|
256
|
+
ref: I,
|
|
257
|
+
autoFocus: Me,
|
|
258
|
+
placeholder: a.length ? "" : De,
|
|
259
|
+
prefixCls: `${o}-input`,
|
|
260
|
+
autoFitWidth: {
|
|
261
|
+
delay: () => Fe.current,
|
|
262
|
+
pure: !0
|
|
263
|
+
},
|
|
264
|
+
onPressEnter: async (e) => {
|
|
265
|
+
b && e.preventDefault(), W == null || W(e), await le();
|
|
266
|
+
},
|
|
267
|
+
onFocus: (e) => {
|
|
268
|
+
!fe && !g && (ne(!0), j == null || j(e));
|
|
269
|
+
},
|
|
270
|
+
onBlur: async (e) => {
|
|
271
|
+
ne(!1), H == null || H(e), ke && await le(), S("");
|
|
272
|
+
},
|
|
273
|
+
value: b,
|
|
274
|
+
onChange: (e, t) => {
|
|
275
|
+
z == null || z(e, t), t.nativeEvent.inputType !== "insertFromPaste" && ue(e), U.current ? S("") : S(e);
|
|
276
|
+
},
|
|
277
|
+
onKeyDown: (e) => {
|
|
278
|
+
He(e), x == null || x(e);
|
|
279
|
+
},
|
|
280
|
+
onPaste: (e) => {
|
|
281
|
+
O == null || O(e), ue(e.clipboardData.getData("text"));
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
)
|
|
285
|
+
},
|
|
286
|
+
ft
|
|
287
|
+
)
|
|
288
|
+
], We = !T(Q), de = !T(Z) || !T(pe), me = !T(ee), ge = !T(te), D = me || ge, ve = f.status || (Re ? "error" : void 0), he = M(o, {
|
|
289
|
+
[`${o}-size-${P}`]: P,
|
|
290
|
+
[`${o}-disabled`]: h,
|
|
291
|
+
[`${o}-${ve}`]: ve,
|
|
292
|
+
[`${o}-focus`]: w,
|
|
293
|
+
[`${o}-readonly`]: g,
|
|
294
|
+
[`${o}-has-suffix`]: de,
|
|
295
|
+
[`${o}-has-placeholder`]: !a.length,
|
|
296
|
+
[`${o}-rtl`]: Y
|
|
297
|
+
}), R = { style: Se, className: we }, ye = /* @__PURE__ */ i(
|
|
298
|
+
"div",
|
|
299
|
+
{
|
|
300
|
+
...ut(xe, ["status", "size", "defaultValue", "value", "inputValue"]),
|
|
301
|
+
...D ? {} : R,
|
|
302
|
+
className: D ? he : M(he, R.className),
|
|
303
|
+
onMouseDown: (e) => {
|
|
304
|
+
w && _(e);
|
|
305
|
+
},
|
|
306
|
+
onClick: (e) => {
|
|
307
|
+
var t;
|
|
308
|
+
!w && ((t = I.current) == null || t.focus()), re && re(e);
|
|
309
|
+
},
|
|
310
|
+
ref: D ? void 0 : G,
|
|
311
|
+
children: /* @__PURE__ */ A("div", { className: `${o}-view`, children: [
|
|
312
|
+
We && /* @__PURE__ */ i("div", { className: `${o}-prefix`, onMouseDown: _, children: Q }),
|
|
313
|
+
je ? /* @__PURE__ */ i(
|
|
314
|
+
Te,
|
|
315
|
+
{
|
|
316
|
+
prefixCls: o,
|
|
317
|
+
animation: J,
|
|
318
|
+
children: /* @__PURE__ */ i(
|
|
319
|
+
tt,
|
|
320
|
+
{
|
|
321
|
+
itemWrapperStyle: { display: "inline-block" },
|
|
322
|
+
direction: "horizontal",
|
|
323
|
+
onIndexChange: (e, t) => {
|
|
324
|
+
N(function(n, l, u) {
|
|
325
|
+
n = n.slice();
|
|
326
|
+
const p = l > u, [v] = n.splice(l, 1);
|
|
327
|
+
return n.splice(p ? u : u - 1, 0, v), n;
|
|
328
|
+
}(a, t, e), "sort");
|
|
329
|
+
},
|
|
330
|
+
children: K.concat(q)
|
|
331
|
+
}
|
|
332
|
+
)
|
|
333
|
+
},
|
|
334
|
+
"transitionGroupWithDrag"
|
|
335
|
+
) : /* @__PURE__ */ i(Te, { prefixCls: o, animation: J, children: V === pt ? /* @__PURE__ */ i(
|
|
336
|
+
rt,
|
|
337
|
+
{
|
|
338
|
+
items: K,
|
|
339
|
+
suffixItems: q,
|
|
340
|
+
ellipsisNode: ({ ellipsisCount: e }) => ie(e)
|
|
341
|
+
}
|
|
342
|
+
) : K.concat(q) }),
|
|
343
|
+
de && /* @__PURE__ */ A("div", { className: `${o}-suffix`, onMouseDown: _, children: [
|
|
344
|
+
pe,
|
|
345
|
+
Z
|
|
346
|
+
] })
|
|
347
|
+
] })
|
|
348
|
+
}
|
|
349
|
+
);
|
|
350
|
+
return D ? /* @__PURE__ */ A(
|
|
351
|
+
"div",
|
|
352
|
+
{
|
|
353
|
+
...R,
|
|
354
|
+
className: M(
|
|
355
|
+
`${o}-wrapper`,
|
|
356
|
+
{
|
|
357
|
+
[`${o}-wrapper-rtl`]: Y
|
|
358
|
+
},
|
|
359
|
+
R.className
|
|
360
|
+
),
|
|
361
|
+
ref: G,
|
|
362
|
+
children: [
|
|
363
|
+
me && /* @__PURE__ */ i("div", { className: `${o}-addbefore`, children: ee }),
|
|
364
|
+
ye,
|
|
365
|
+
ge && /* @__PURE__ */ i("div", { className: `${o}-addafter`, children: te })
|
|
366
|
+
]
|
|
367
|
+
}
|
|
368
|
+
) : ye;
|
|
369
|
+
}
|
|
370
|
+
const vt = Ce.forwardRef(
|
|
371
|
+
gt
|
|
372
|
+
);
|
|
373
|
+
vt.displayName = "InputTag";
|
|
374
|
+
export {
|
|
375
|
+
vt as I
|
|
376
|
+
};
|