@unicom-cloud/ui 0.8.61 → 0.8.62

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.
Files changed (179) hide show
  1. package/Affix.js +1 -1
  2. package/Alert.js +44 -40
  3. package/Anchor.js +1 -1
  4. package/AutoComplete.js +4 -4
  5. package/Avatar.js +1 -1
  6. package/BackTop.js +7 -7
  7. package/Badge.js +2 -2
  8. package/Breadcrumb.js +22 -22
  9. package/Button.js +2 -2
  10. package/Calendar.js +106 -104
  11. package/Card.js +1 -1
  12. package/Carousel.js +34 -33
  13. package/Cascader.js +1 -1
  14. package/Checkbox.js +1 -1
  15. package/Collapse.js +1 -1
  16. package/ColorPicker.js +12 -12
  17. package/Comment.js +1 -1
  18. package/ConfigProvider.js +2 -2
  19. package/Copy.js +16 -16
  20. package/DatePicker.js +165 -162
  21. package/Descriptions.js +1 -1
  22. package/Divider.js +1 -1
  23. package/Draggable.js +1 -1
  24. package/Drawer.js +1 -1
  25. package/Dropdown.js +9 -9
  26. package/Empty.js +2 -2
  27. package/Form.js +60 -54
  28. package/Grid.js +2 -2
  29. package/Icon.js +1 -1
  30. package/IconHover.js +1 -1
  31. package/Image.js +1 -1
  32. package/Input.js +1 -1
  33. package/InputNumber.js +6 -6
  34. package/InputTag.js +1 -1
  35. package/Layout.js +2 -2
  36. package/Link.js +14 -14
  37. package/List.js +3 -3
  38. package/Mentions.js +3 -3
  39. package/Menu.js +1 -1
  40. package/Message.js +2 -2
  41. package/Modal.js +1 -1
  42. package/Notice.js +9 -3
  43. package/Notification.js +2 -2
  44. package/OverflowEllipsis.js +32 -32
  45. package/PageHeader.js +23 -22
  46. package/Pagination.js +1 -1
  47. package/Picker.js +1 -1
  48. package/Popconfirm.js +7 -7
  49. package/Popover.js +1 -1
  50. package/Progress.js +14 -14
  51. package/Radio.js +2 -2
  52. package/Rate.js +43 -40
  53. package/ResizeBox.js +97 -96
  54. package/Result.js +15 -15
  55. package/Select.js +1 -1
  56. package/SelectView.js +295 -249
  57. package/Skeleton.js +1 -1
  58. package/Slider.js +25 -25
  59. package/Space.js +1 -1
  60. package/SpeechSynthesis.js +32 -29
  61. package/Spin.js +2 -2
  62. package/Statistic.js +1 -1
  63. package/Steps.js +11 -11
  64. package/Switch.js +3 -3
  65. package/Table.js +9 -9
  66. package/Tabs.js +1 -1
  67. package/Tag.js +68 -67
  68. package/TimePicker.js +17 -17
  69. package/Timeline.js +1 -1
  70. package/Tooltip.js +1 -1
  71. package/Transfer.js +47 -46
  72. package/Tree.js +2 -2
  73. package/TreeSelect.js +1 -1
  74. package/Trigger.js +3 -3
  75. package/Typography.js +1 -1
  76. package/Upload.js +2 -2
  77. package/VerificationCode.js +1 -1
  78. package/Version.js +1 -1
  79. package/Watermark.js +1 -1
  80. package/chunk/{V6euPXVB.js → -Z968QpN.js} +257 -251
  81. package/chunk/{IooeSKJJ.js → AqH9yP_J.js} +19 -19
  82. package/chunk/{cZiP8FvM.js → B0oDiPqE.js} +1 -1
  83. package/chunk/{B16KHtX-.js → B4-WpgY2.js} +191 -185
  84. package/chunk/{CuOl4X0X.js → B8SZFOjt.js} +1 -1
  85. package/chunk/{CbiWdbr_.js → BXWxA-tS.js} +35 -34
  86. package/chunk/{DpfUGhi4.js → BlNFmhNa.js} +288 -283
  87. package/chunk/{C1xMmQIZ.js → BmO1y0vr.js} +34 -34
  88. package/chunk/{Kbr6FzOG.js → BnqeQYIZ.js} +210 -186
  89. package/chunk/{BPZ-6HKJ.js → Bp3XomF8.js} +1 -2
  90. package/chunk/BsWphzcT.js +20 -0
  91. package/chunk/{RMBPs_Ry.js → C4eJ9vCf.js} +4 -3
  92. package/chunk/{BNHrEI0Y.js → C6fEFlPt.js} +52 -48
  93. package/chunk/C8o-VGyc.js +376 -0
  94. package/chunk/{eK7lxdak.js → CDJ1EnJ2.js} +8 -8
  95. package/chunk/{C5AQWbC4.js → CHyuuVxl.js} +1 -1
  96. package/chunk/{B2vORJQ8.js → CJnshq6A.js} +13 -13
  97. package/chunk/CT1lZ7ss.js +116 -0
  98. package/chunk/{Bdh4XVuf.js → CV1kLw5Z.js} +290 -281
  99. package/chunk/{DmUhn9ib.js → CazXy0r4.js} +54 -53
  100. package/chunk/{BBVjSFnw.js → Cqyp4qni.js} +23 -19
  101. package/chunk/{BJ_7JTqC.js → D3VMG9V1.js} +1 -1
  102. package/chunk/{D2HkyI6A.js → DGasAUHE.js} +2 -2
  103. package/chunk/{YIlBPVAs.js → DRQ1v6Ux.js} +1 -1
  104. package/chunk/{DhBo0pPJ.js → DRp7voqz.js} +119 -118
  105. package/chunk/{gIbzjQ-X.js → Dtm4BmKB.js} +2 -2
  106. package/chunk/{BEDYCG-I.js → KchYsivk.js} +18 -18
  107. package/chunk/{Cbd50gx8.js → Wum88vrW.js} +33 -33
  108. package/chunk/{BjSHZA0m.js → mfn4EgmQ.js} +1 -1
  109. package/chunk/{BYhtrDV3.js → nbEvdwT0.js} +152 -148
  110. package/chunk/{C1D7T29r.js → qpd2axxs.js} +83 -76
  111. package/chunk/{BVLwPZis.js → tOFzwzpT.js} +31 -30
  112. package/chunk/{DSGRHf-1.js → yESVS-qX.js} +157 -156
  113. package/hooks/useMergeValue.js +1 -1
  114. package/icons.js +4 -6001
  115. package/index.js +420 -392
  116. package/locale/en-US.js +1 -1
  117. package/locale/tr-TR.js +1 -1
  118. package/package.json +1 -1
  119. package/style.css +1 -1
  120. package/types/cascader/panel/Search.d.ts +1 -1
  121. package/types/config-provider/interface.d.ts +1 -1
  122. package/types/form/interface.d.ts +1 -1
  123. package/types/index.d.ts +1 -1
  124. package/types/message/index.d.ts +2 -2
  125. package/types/notification/index.d.ts +2 -2
  126. package/types/notification-base/index.d.ts +2 -2
  127. package/types/select/interface.d.ts +1 -0
  128. package/types/select-view/interface.d.ts +1 -0
  129. package/types/tree/Context.d.ts +1 -0
  130. package/types/tree/Tree.d.ts +1 -1
  131. package/types/tree/index.d.ts +5 -4
  132. package/types/tree/interface.d.ts +1 -0
  133. package/types/utils/index.d.ts +1 -0
  134. package/types/utils/lodash.d.ts +14 -1
  135. package/types/version/index.d.ts +1 -1
  136. package/utils/CSSTransition.js +1 -1
  137. package/utils/caseName.js +2 -18
  138. package/utils/contextHolder.js +1 -1
  139. package/utils/index.js +220 -191
  140. package/utils/is.js +68 -67
  141. package/utils/lodash.js +32 -6
  142. package/utils/reactDOM.js +1 -1
  143. package/chunk/-LZOUh53.js +0 -29
  144. package/chunk/-jdfq71f.js +0 -23
  145. package/chunk/B0GOLsj_.js +0 -58
  146. package/chunk/B7Zsp3gO.js +0 -29
  147. package/chunk/BDjXkzNj.js +0 -23
  148. package/chunk/BHn4xgbv.js +0 -209
  149. package/chunk/BLSiP_gg.js +0 -32
  150. package/chunk/BMJfSSLX.js +0 -23
  151. package/chunk/B_nfMl0e.js +0 -116
  152. package/chunk/BcS17Pzy.js +0 -66
  153. package/chunk/BdiEwtQO.js +0 -41
  154. package/chunk/Bpug_KxP.js +0 -34
  155. package/chunk/C1u_ckwU.js +0 -29
  156. package/chunk/C43Hv2Bl.js +0 -34
  157. package/chunk/C9vsih_D.js +0 -29
  158. package/chunk/CAfR2wLq.js +0 -41
  159. package/chunk/CAfecMDF.js +0 -46
  160. package/chunk/CKp4rZnD.js +0 -207
  161. package/chunk/CV2Aqv9q.js +0 -52
  162. package/chunk/CYdarMv9.js +0 -32
  163. package/chunk/C_S5Mdvd.js +0 -379
  164. package/chunk/CmB-TL7C.js +0 -46
  165. package/chunk/D-ER56Sf.js +0 -29
  166. package/chunk/D-aYnb6u.js +0 -41
  167. package/chunk/D3xQFJcO.js +0 -23
  168. package/chunk/DJcEys80.js +0 -29
  169. package/chunk/DLIm6rRJ.js +0 -29
  170. package/chunk/DOWEHtqM.js +0 -41
  171. package/chunk/DT37l12z.js +0 -40
  172. package/chunk/DW-B7npC.js +0 -23
  173. package/chunk/D_MTFBb0.js +0 -38
  174. package/chunk/Dx_5J4fO.js +0 -29
  175. package/chunk/Dy487FZ1.js +0 -118
  176. package/chunk/Uz-rNulO.js +0 -98
  177. package/chunk/cDZI_t6o.js +0 -52
  178. package/chunk/sScV-J56.js +0 -206
  179. package/chunk/wI2I1qb0.js +0 -23
@@ -780,8 +780,7 @@ const f = {
780
780
  out: "out-in",
781
781
  in: "in-out"
782
782
  }, k = (n, e, t) => (...s) => {
783
- var i, r;
784
- (r = (i = n.props)[e]) == null || r.call(i, ...s), t();
783
+ n.props[e] && n.props[e](...s), t();
785
784
  }, re = {
786
785
  [f.out]: ({ current: n, changeState: e }) => c.cloneElement(n, {
787
786
  in: !1,
@@ -0,0 +1,20 @@
1
+ import p from "lodash/camelCase.js";
2
+ import s from "lodash/capitalize.js";
3
+ import f from "lodash/kebabCase.js";
4
+ import n from "lodash/snakeCase.js";
5
+ import C from "lodash/startCase.js";
6
+ import N from "lodash/upperFirst.js";
7
+ function x(m) {
8
+ const o = f(m), r = s(m), e = p(m), t = n(m), a = C(m), i = N(e);
9
+ return {
10
+ kebabCaseName: o,
11
+ capitalizeName: r,
12
+ camelCaseName: e,
13
+ snakeCaseName: t,
14
+ startCaseName: a,
15
+ ComponentCaseName: i
16
+ };
17
+ }
18
+ export {
19
+ x as d
20
+ };
@@ -1,13 +1,14 @@
1
1
  import { jsxs as w, jsx as r } from "react/jsx-runtime";
2
- import { I as L, a as U } from "./B0GOLsj_.js";
2
+ import U from "@unicom-cloud/icons/IconUiCaretLeft";
3
+ import L from "@unicom-cloud/icons/IconUiCaretRight";
3
4
  import V from "lodash/isFunction";
4
5
  import M, { useContext as K, useRef as A, createContext as B } from "react";
5
- import { d as T, I as S } from "./Bdh4XVuf.js";
6
+ import { d as T, I as S } from "./CV1kLw5Z.js";
6
7
  import { useMergeProps as q } from "../hooks/useMergeProps.js";
7
8
  import { useMergeValue as D } from "../hooks/useMergeValue.js";
8
9
  import { y as u } from "./BzPkh4Zv.js";
9
10
  import G from "../utils/omit.js";
10
- import { h as J } from "./BPZ-6HKJ.js";
11
+ import { h as J } from "./Bp3XomF8.js";
11
12
  import { useKeyboardEvent as Q } from "../hooks/useKeyboardEvent.js";
12
13
  import { off as W, on as X } from "../utils/dom.js";
13
14
  function Y(l, g) {
@@ -1,44 +1,48 @@
1
1
  import { jsx as i, jsxs as L, Fragment as nn } from "react/jsx-runtime";
2
- import { b as we, a as tn, c as on, d as rn, I as ln } from "./BHn4xgbv.js";
3
- import ye from "lodash/isFunction";
4
- import sn, { forwardRef as Ie, useState as I, useImperativeHandle as an, useRef as g, useContext as cn, useCallback as S, useEffect as oe } from "react";
5
- import Te from "../Button.js";
6
- import { h as T, a as $e, i as un, j as dn, C as mn, s as fn, d as pn, k as y, I as Cn } from "./Bdh4XVuf.js";
2
+ import tn from "@unicom-cloud/icons/IconUiClose";
3
+ import we from "lodash/isFunction";
4
+ import on, { forwardRef as Ie, useState as I, useImperativeHandle as rn, useRef as g, useContext as ln, useCallback as S, useEffect as oe } from "react";
5
+ import ye from "../Button.js";
6
+ import { h as T, a as $e, i as sn, j as an, C as cn, s as un, d as dn, k as y, I as mn } from "./CV1kLw5Z.js";
7
7
  import "lodash/isEqualWith";
8
- import { useMergeValue as hn } from "../hooks/useMergeValue.js";
8
+ import { useMergeValue as fn } from "../hooks/useMergeValue.js";
9
9
  import "../utils/is.js";
10
- import { d as bn } from "./C2lIz2F9.js";
10
+ import { d as pn } from "./C2lIz2F9.js";
11
11
  import "lodash/isNumber";
12
12
  import "lodash/merge";
13
- import { isServerRendering as gn, contains as vn } from "../utils/dom.js";
13
+ import { isServerRendering as Cn, contains as hn } from "../utils/dom.js";
14
14
  import "../hooks/useIntersectionObserver.js";
15
- import { useMergeProps as xn } from "../hooks/useMergeProps.js";
16
- import { useOverflowHidden as kn } from "../hooks/useOverflowHidden.js";
17
- import { render as En, findDOMNode as Mn } from "../utils/reactDOM.js";
18
- import { useUpdateEffect as wn } from "../hooks/useUpdateEffect.js";
19
- import yn from "../Portal.js";
20
- import { P as Pe } from "./BPZ-6HKJ.js";
21
- import { y as Ne } from "./BzPkh4Zv.js";
22
- import Tn from "../utils/omit.js";
15
+ import { useMergeProps as bn } from "../hooks/useMergeProps.js";
16
+ import { useOverflowHidden as gn } from "../hooks/useOverflowHidden.js";
17
+ import { render as vn, findDOMNode as xn } from "../utils/reactDOM.js";
18
+ import { useUpdateEffect as kn } from "../hooks/useUpdateEffect.js";
19
+ import En from "../Portal.js";
20
+ import { P as Te } from "./Bp3XomF8.js";
21
+ import { y as Pe } from "./BzPkh4Zv.js";
22
+ import Mn from "../utils/omit.js";
23
+ import wn from "@unicom-cloud/icons/IconUiCheckCircleFill";
24
+ import yn from "@unicom-cloud/icons/IconUiCloseCircleFill";
25
+ import Ne from "@unicom-cloud/icons/IconUiExclamationCircleFill";
26
+ import Tn from "@unicom-cloud/icons/IconUiInfoCircleFill";
23
27
  function Pn(n) {
24
- const { prefixCls: l, simple: c } = dn();
28
+ const { prefixCls: l, simple: c } = an();
25
29
  return /* @__PURE__ */ i(M, { prefixCls: l, simple: c, ...n, children: n.content });
26
30
  }
27
31
  const V = (n) => {
28
32
  let l = n.icon;
29
- if (!l && l !== null && (l = /* @__PURE__ */ i(we, {}), n.isNotice))
33
+ if (!l && l !== null && (l = /* @__PURE__ */ i(Ne, {}), n.isNotice))
30
34
  switch (n.noticeType) {
31
35
  case "info":
32
- l = /* @__PURE__ */ i(rn, {});
36
+ l = /* @__PURE__ */ i(Tn, {});
33
37
  break;
34
38
  case "success":
35
- l = /* @__PURE__ */ i(on, {});
39
+ l = /* @__PURE__ */ i(wn, {});
36
40
  break;
37
41
  case "warning":
38
- l = /* @__PURE__ */ i(we, {});
42
+ l = /* @__PURE__ */ i(Ne, {});
39
43
  break;
40
44
  case "error":
41
- l = /* @__PURE__ */ i(tn, {});
45
+ l = /* @__PURE__ */ i(yn, {});
42
46
  break;
43
47
  }
44
48
  return n.noticeType === "show" && (l = n.icon), n.isNotice && (n.hideCancel = !0), n.title = l === null && n.title === null ? null : /* @__PURE__ */ L("span", { children: [
@@ -50,10 +54,10 @@ function le(n, l) {
50
54
  let c;
51
55
  const s = document.createElement("div");
52
56
  document.body.appendChild(s);
53
- const f = un();
57
+ const f = sn();
54
58
  function v(a) {
55
59
  const C = /* @__PURE__ */ i($e, { ...f, children: /* @__PURE__ */ i(Pn, { ...a, onCancel: h }) });
56
- c ? c.render(C) : c = En(C, s);
60
+ c ? c.render(C) : c = vn(C, s);
57
61
  }
58
62
  const o = v;
59
63
  let r = {
@@ -106,7 +110,7 @@ function le(n, l) {
106
110
  }
107
111
  function Nn(n, l) {
108
112
  const [c, s] = I(!0), [f, v] = I(n);
109
- an(l, () => ({
113
+ rn(l, () => ({
110
114
  update: (u) => {
111
115
  v(u);
112
116
  },
@@ -151,7 +155,7 @@ function Nn(n, l) {
151
155
  }
152
156
  const In = Ie(Nn);
153
157
  function $n() {
154
- const n = g(), l = /* @__PURE__ */ i(mn, { ref: n });
158
+ const n = g(), l = /* @__PURE__ */ i(cn, { ref: n });
155
159
  let c = 0;
156
160
  function s(o) {
157
161
  var C;
@@ -210,7 +214,7 @@ function $n() {
210
214
  }), [v, l];
211
215
  }
212
216
  let re = null, Dn = 0;
213
- gn || document.documentElement.addEventListener(
217
+ Cn || document.documentElement.addEventListener(
214
218
  "click",
215
219
  (n) => {
216
220
  re = {
@@ -233,7 +237,7 @@ const On = {
233
237
  function Rn(n, l) {
234
238
  var Me;
235
239
  l || (l = g());
236
- const c = cn(pn), s = xn(
240
+ const c = ln(dn), s = bn(
237
241
  n,
238
242
  On,
239
243
  (Me = c.componentConfig) == null ? void 0 : Me.Modal
@@ -274,11 +278,11 @@ function Rn(n, l) {
274
278
  o && A.current && (A.current = !1);
275
279
  const B = g();
276
280
  B.current || (B.current = Dn++);
277
- const [Se, K] = hn(!1, {
281
+ const [Se, K] = fn(!1, {
278
282
  defaultValue: !1,
279
283
  value: De
280
- }), d = c.getPrefixCls("modal", s.prefixCls), { locale: G, rtl: be } = c, Ve = !r || ce.noticeType === "show", ze = "closable" in s ? s.closable : Ve, je = S(() => Mn(p()), [p]);
281
- kn(je, { hidden: o && X });
284
+ }), d = c.getPrefixCls("modal", s.prefixCls), { locale: G, rtl: be } = c, Ve = !r || ce.noticeType === "show", ze = "closable" in s ? s.closable : Ve, je = S(() => xn(p()), [p]);
285
+ gn(je, { hidden: o && X });
282
286
  function J(e) {
283
287
  e.stopPropagation(), Q();
284
288
  }
@@ -287,7 +291,7 @@ function Rn(n, l) {
287
291
  (e = s.onCancel) == null || e.call(s);
288
292
  }
289
293
  const qe = (e) => {
290
- Z && o && e.key === bn.key && (e.stopPropagation(), Q());
294
+ Z && o && e.key === pn.key && (e.stopPropagation(), Q());
291
295
  }, _ = g(!1), We = (e) => {
292
296
  D.current && (D.current = !1, !_.current && Re && X && e.target === e.currentTarget && setTimeout(() => {
293
297
  Q();
@@ -304,7 +308,7 @@ function Rn(n, l) {
304
308
  }
305
309
  ));
306
310
  };
307
- wn(() => {
311
+ kn(() => {
308
312
  var t, m;
309
313
  let e = l == null ? void 0 : l.current;
310
314
  if (!e)
@@ -323,7 +327,7 @@ function Rn(n, l) {
323
327
  let e = null;
324
328
  return Z && (e = setTimeout(() => {
325
329
  var t;
326
- vn(document.body, $.current) && ((t = $.current) == null || t.focus());
330
+ hn(document.body, $.current) && ((t = $.current) == null || t.focus());
327
331
  })), () => {
328
332
  e && clearTimeout(e);
329
333
  };
@@ -336,8 +340,8 @@ function Rn(n, l) {
336
340
  }
337
341
  }, Ke = () => {
338
342
  if (H === null) return;
339
- const e = /* @__PURE__ */ i(Te, { onClick: J, ...C, children: w || G.Modal.cancelText }), t = /* @__PURE__ */ i(
340
- Te,
343
+ const e = /* @__PURE__ */ i(ye, { onClick: J, ...C, children: w || G.Modal.cancelText }), t = /* @__PURE__ */ i(
344
+ ye,
341
345
  {
342
346
  loading: Se,
343
347
  onClick: Ze,
@@ -345,7 +349,7 @@ function Rn(n, l) {
345
349
  ...a,
346
350
  children: k || G.Modal.okText
347
351
  }
348
- ), m = ye(H) ? H(e, t) : H || /* @__PURE__ */ L(nn, { children: [
352
+ ), m = we(H) ? H(e, t) : H || /* @__PURE__ */ L(nn, { children: [
349
353
  !Oe && e,
350
354
  t
351
355
  ] });
@@ -444,14 +448,14 @@ function Rn(n, l) {
444
448
  children: ae
445
449
  }
446
450
  ) : /* @__PURE__ */ i(
447
- Cn,
451
+ mn,
448
452
  {
449
453
  tabIndex: -1,
450
454
  className: `${d}-close-icon`,
451
455
  onClick: J,
452
456
  role: "button",
453
457
  "aria-label": "Close",
454
- children: /* @__PURE__ */ i(ln, {})
458
+ children: /* @__PURE__ */ i(tn, {})
455
459
  }
456
460
  ))
457
461
  ]
@@ -462,7 +466,7 @@ function Rn(n, l) {
462
466
  role: "dialog",
463
467
  "aria-modal": "true",
464
468
  ..._e,
465
- className: Ne(
469
+ className: Pe(
466
470
  d,
467
471
  {
468
472
  [`${d}-simple`]: r,
@@ -490,7 +494,7 @@ function Rn(n, l) {
490
494
  he(t);
491
495
  }, Ee = A.current ? !j : !!E.current;
492
496
  return o || Ee ? /* @__PURE__ */ i(
493
- yn,
497
+ En,
494
498
  {
495
499
  visible: o,
496
500
  forceRender: Ee,
@@ -502,7 +506,7 @@ function Rn(n, l) {
502
506
  className: `${d}-container`,
503
507
  children: [
504
508
  X ? /* @__PURE__ */ i(
505
- Pe,
509
+ Te,
506
510
  {
507
511
  in: o,
508
512
  timeout: 400,
@@ -529,7 +533,7 @@ function Rn(n, l) {
529
533
  /* @__PURE__ */ i(
530
534
  "div",
531
535
  {
532
- ...Tn(ce, [
536
+ ...Mn(ce, [
533
537
  "content",
534
538
  "icon",
535
539
  "showIcon",
@@ -545,7 +549,7 @@ function Rn(n, l) {
545
549
  ref: (e) => {
546
550
  $.current = e, Ae();
547
551
  },
548
- className: Ne(
552
+ className: Pe(
549
553
  `${d}-wrapper`,
550
554
  {
551
555
  [`${d}-wrapper-no-mask`]: !X,
@@ -566,7 +570,7 @@ function Rn(n, l) {
566
570
  },
567
571
  onClick: We,
568
572
  children: /* @__PURE__ */ i(
569
- Pe,
573
+ Te,
570
574
  {
571
575
  in: o,
572
576
  timeout: 400,
@@ -586,8 +590,8 @@ function Rn(n, l) {
586
590
  onExited: (e) => {
587
591
  e && (me(!1), te(e), z == null || z(), _.current = !1, q && (E.current = null));
588
592
  },
589
- children: sn.cloneElement(
590
- ye(ie) ? ie(ke) : ke,
593
+ children: on.cloneElement(
594
+ we(ie) ? ie(ke) : ke,
591
595
  {
592
596
  onMouseDown: () => {
593
597
  D.current = !1;
@@ -611,7 +615,7 @@ const M = Ie(
611
615
  Rn
612
616
  );
613
617
  M.displayName = "Modal";
614
- M.config = fn;
618
+ M.config = un;
615
619
  M.show = (n) => le({ ...n, noticeType: "show" });
616
620
  M.confirm = (n) => le(n);
617
621
  M.useModal = $n;
@@ -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 "./Bp3XomF8.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 "./CV1kLw5Z.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 "./Dtm4BmKB.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
+ };