@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
package/SelectView.js CHANGED
@@ -1,296 +1,342 @@
1
- import { jsx as r, jsxs as R } from "react/jsx-runtime";
2
- import Ie, { useRef as se, useContext as Ue, useState as ge, useEffect as We, useImperativeHandle as ve, useMemo as ze } from "react";
3
- import { y as N } from "./chunk/BzPkh4Zv.js";
1
+ import { jsx as n, jsxs as k, Fragment as Xe } from "react/jsx-runtime";
2
+ import Ee, { useRef as ue, useContext as Je, useState as Ie, useEffect as Qe, useImperativeHandle as De, useMemo as Ye, createElement as Ze } from "react";
3
+ import { y as A } from "./chunk/BzPkh4Zv.js";
4
4
  import "./utils/is.js";
5
- import { pickDataAttributes as je } from "./utils/pick.js";
6
- import { e as Ge, I as He } from "./chunk/BHn4xgbv.js";
7
- import { I as Ke } from "./chunk/BDjXkzNj.js";
8
- import { I as Le } from "./chunk/Dx_5J4fO.js";
9
- import _e from "lodash/isFunction";
10
- import we from "lodash/isUndefined";
11
- import { d as Ye, I as qe } from "./chunk/Bdh4XVuf.js";
12
- import { useForceUpdate as Je } from "./hooks/useForceUpdate.js";
13
- import { usePersistCallback as Qe } from "./hooks/usePersistCallback.js";
14
- import { I as Xe } from "./chunk/C_S5Mdvd.js";
15
- import { I as Ze } from "./chunk/gIbzjQ-X.js";
16
- import eo from "./Tag.js";
17
- import be from "./utils/fillNBSP.js";
18
- import oo from "./utils/include.js";
19
- import { E as to, B as ro } from "./chunk/C2lIz2F9.js";
20
- import C from "lodash/isPlainObject";
21
- const v = {
5
+ import { pickDataAttributes as eo } from "./utils/pick.js";
6
+ import oo from "@unicom-cloud/icons/IconUiClose";
7
+ import to from "@unicom-cloud/icons/IconUiDown";
8
+ import ro from "@unicom-cloud/icons/IconUiLoading";
9
+ import no from "@unicom-cloud/icons/IconUiSearch";
10
+ import so from "lodash/isFunction";
11
+ import $e from "lodash/isUndefined";
12
+ import { d as ao, I as lo } from "./chunk/CV1kLw5Z.js";
13
+ import { useForceUpdate as co } from "./hooks/useForceUpdate.js";
14
+ import { usePersistCallback as io } from "./hooks/usePersistCallback.js";
15
+ import { I as uo } from "./chunk/C8o-VGyc.js";
16
+ import { I as fo } from "./chunk/Dtm4BmKB.js";
17
+ import po from "./Popover.js";
18
+ import Te from "./Tag.js";
19
+ import ye from "./utils/fillNBSP.js";
20
+ import mo from "./utils/include.js";
21
+ import { E as ho, B as go } from "./chunk/C2lIz2F9.js";
22
+ import "./chunk/Cqyp4qni.js";
23
+ import T from "lodash/isPlainObject";
24
+ import Se from "lodash/isNumber";
25
+ const ie = "__pqb_value_tag_placeholder", $ = {
22
26
  BEFORE: 0,
23
27
  EDITING: 1,
24
28
  NONE: 2
25
- }, no = 1, so = Ie.forwardRef(function(d, x) {
29
+ }, bo = Ee.forwardRef(function(m, y) {
26
30
  const {
27
- id: M,
28
- style: O,
29
- className: U,
30
- size: $,
31
- bordered: W,
32
- allowClear: k,
33
- allowCreate: y,
34
- status: z,
35
- loading: E,
36
- disabled: l,
31
+ id: W,
32
+ style: z,
33
+ className: L,
34
+ size: S,
35
+ bordered: j,
36
+ allowClear: F,
37
+ allowCreate: E,
38
+ status: H,
39
+ loading: R,
40
+ disabled: i,
37
41
  animation: V,
38
42
  prefixCls: o,
39
- suffixIcon: f,
40
- arrowIcon: p,
41
- removeIcon: P,
42
- clearIcon: m,
43
- placeholder: ae,
44
- renderText: le,
45
- value: w,
46
- inputValue: j,
47
- popupVisible: h,
48
- maxTagCount: s,
43
+ suffixIcon: h,
44
+ arrowIcon: g,
45
+ removeIcon: O,
46
+ clearIcon: b,
47
+ placeholder: de,
48
+ renderText: fe,
49
+ value: C,
50
+ inputValue: G,
51
+ popupVisible: v,
52
+ maxTagCount: a,
49
53
  isMultiple: I,
50
- isEmptyValue: G,
51
- prefix: H,
52
- ariaControls: Ne,
53
- renderTag: ie,
54
- dragToSort: ce,
55
- rtl: Ce,
56
- htmlDataAttributes: xe,
57
- onKeyDown: K,
58
- onChangeInputValue: L,
59
- onPaste: $e,
60
- onClear: ye,
61
- onFocus: _,
62
- onBlur: Y,
63
- onRemoveCheckedItem: q,
64
- onSort: ue,
65
- ...Se
66
- } = d, S = se(null), g = se(null), { size: Te, getPrefixCls: de } = Ue(Ye), [De, fe] = ge(v.NONE), [J, pe] = ge(!1), ke = Je(), T = "showSearch" in d ? d.showSearch : I, c = T || y, A = $ || Te, Q = J || h, Ee = C(T) && T.retainInputValue, b = !I && w !== void 0 ? le(w).text : "", X = (e) => {
54
+ isEmptyValue: K,
55
+ prefix: q,
56
+ ariaControls: Pe,
57
+ renderTag: X,
58
+ dragToSort: pe,
59
+ rtl: ke,
60
+ htmlDataAttributes: Ae,
61
+ onKeyDown: J,
62
+ onChangeInputValue: Q,
63
+ onPaste: Fe,
64
+ onClear: Re,
65
+ onFocus: Y,
66
+ onBlur: Z,
67
+ onRemoveCheckedItem: ee,
68
+ onSort: oe,
69
+ ...Ve
70
+ } = m, D = ue(null), w = ue(null), { size: Oe, getPrefixCls: me } = Je(ao), [Be, he] = Ie($.NONE), [te, ge] = Ie(!1), Me = co(), P = "showSearch" in m ? m.showSearch : I, f = P || E, B = S || Oe, re = te || v, _e = T(P) && P.retainInputValue, x = !I && C !== void 0 ? fe(C).text : "", ne = (e) => {
67
71
  e && e.preventDefault();
68
- }, Z = (e) => {
69
- const t = c ? S.current : g.current;
72
+ }, se = (e) => {
73
+ const t = f ? D.current : w.current;
70
74
  t && (e === "focus" ? t.focus() : t.blur());
71
- }, F = (e, t) => {
72
- c && t.target === g.current || (e === "focus" ? (pe(!0), _ == null || _(t)) : (pe(!1), Y == null || Y(t)));
73
- }, me = (e) => {
74
- if (c && e.currentTarget === g.current)
75
+ }, M = (e, t) => {
76
+ f && t.target === w.current || (e === "focus" ? (ge(!0), Y == null || Y(t)) : (ge(!1), Z == null || Z(t)));
77
+ }, be = (e) => {
78
+ if (f && e.currentTarget === w.current)
75
79
  return;
76
- e.key === to.key && e.preventDefault(), K == null || K(e);
80
+ e.key === ho.key && e.preventDefault(), J == null || J(e);
77
81
  };
78
- We(() => {
79
- Z(h ? "focus" : "blur"), c && fe(h ? v.BEFORE : v.NONE);
80
- }, [h]), ve(x, () => ({
81
- dom: g.current,
82
- getRootDOMNode: () => g.current,
83
- focus: Z.bind(null, "focus"),
84
- blur: Z.bind(null, "blur"),
85
- getWidth: () => g.current && g.current.clientWidth
82
+ Qe(() => {
83
+ se(v ? "focus" : "blur"), f && he(v ? $.BEFORE : $.NONE);
84
+ }, [v]), De(y, () => ({
85
+ dom: w.current,
86
+ getRootDOMNode: () => w.current,
87
+ focus: se.bind(null, "focus"),
88
+ blur: se.bind(null, "blur"),
89
+ getWidth: () => w.current && w.current.clientWidth
86
90
  }));
87
- const Ve = "arrowIcon" in d ? p === null ? null : /* @__PURE__ */ r("div", { className: `${o}-arrow-icon`, children: p }) : /* @__PURE__ */ r("div", { className: `${o}-arrow-icon`, children: /* @__PURE__ */ r(Ke, {}) }), Pe = E ? /* @__PURE__ */ r("span", { className: `${o}-loading-icon`, children: /* @__PURE__ */ r(Ge, {}) }) : f ? /* @__PURE__ */ r("span", { className: `${o}-suffix-icon`, children: f }) : d.showSearch && h ? /* @__PURE__ */ r("div", { className: `${o}-search-icon`, children: /* @__PURE__ */ r(Le, {}) }) : Ve, i = {
88
- paste: $e,
89
- keyDown: me,
91
+ const Ue = "arrowIcon" in m ? g === null ? null : /* @__PURE__ */ n("div", { className: `${o}-arrow-icon`, children: g }) : /* @__PURE__ */ n("div", { className: `${o}-arrow-icon`, children: /* @__PURE__ */ n(to, {}) }), We = R ? /* @__PURE__ */ n("span", { className: `${o}-loading-icon`, children: /* @__PURE__ */ n(ro, {}) }) : h ? /* @__PURE__ */ n("span", { className: `${o}-suffix-icon`, children: h }) : m.showSearch && v ? /* @__PURE__ */ n("div", { className: `${o}-search-icon`, children: /* @__PURE__ */ n(no, {}) }) : Ue, u = {
92
+ paste: Fe,
93
+ keyDown: be,
90
94
  focus: (e) => {
91
- e.stopPropagation(), F("focus", e);
95
+ e.stopPropagation(), M("focus", e);
92
96
  },
93
97
  blur: (e) => {
94
- e.stopPropagation(), F("blur", e);
98
+ e.stopPropagation(), M("blur", e);
95
99
  },
96
100
  change: (e, t) => {
97
- fe(v.EDITING), L == null || L(e, t);
101
+ he($.EDITING), Q == null || Q(e, t);
98
102
  }
99
- }, Ae = () => {
103
+ }, ze = () => {
100
104
  let e;
101
- switch (De) {
102
- case v.BEFORE:
103
- e = j || (Ee ? b : "");
105
+ switch (Be) {
106
+ case $.BEFORE:
107
+ e = G || (_e ? x : "");
104
108
  break;
105
- case v.EDITING:
106
- e = j || "";
109
+ case $.EDITING:
110
+ e = G || "";
107
111
  break;
108
112
  default:
109
- e = b;
113
+ e = x;
110
114
  break;
111
115
  }
112
- const t = !!(Q && c || G), n = {
116
+ const t = !!(re && f || K), s = {
113
117
  style: { width: "100%" },
114
118
  // _inputValue after renderText(value) may be rich text, but the value of <input> cannot be object
115
119
  value: t && typeof e != "object" ? e : "",
116
120
  // Allow placeholder to display the selected value first when searching
117
- placeholder: c && b && typeof b != "object" ? b : ae
121
+ placeholder: f && x && typeof x != "object" ? x : de
118
122
  };
119
- return c ? (n.onPaste = i.paste, n.onKeyDown = i.keyDown, n.onFocus = i.focus, n.onBlur = i.blur, n.onChange = i.change) : (n.tabIndex = -1, n.style.pointerEvents = "none"), /* @__PURE__ */ R("span", { className: `${o}-view-selector`, children: [
120
- /* @__PURE__ */ r(
121
- Ze,
123
+ return f ? (s.onPaste = u.paste, s.onKeyDown = u.keyDown, s.onFocus = u.focus, s.onBlur = u.blur, s.onChange = u.change) : (s.tabIndex = -1, s.style.pointerEvents = "none"), /* @__PURE__ */ k("span", { className: `${o}-view-selector`, children: [
124
+ /* @__PURE__ */ n(
125
+ fo,
122
126
  {
123
127
  "aria-hidden": !t || void 0,
124
- ref: S,
125
- disabled: l,
126
- className: N(`${o}-view-input`, {
128
+ ref: D,
129
+ disabled: i,
130
+ className: A(`${o}-view-input`, {
127
131
  [`${o}-hidden`]: !t
128
132
  }),
129
133
  autoComplete: "off",
130
- ...n
134
+ ...s
131
135
  }
132
136
  ),
133
- t ? /* @__PURE__ */ r("span", { className: `${o}-view-value-mirror`, children: be(n.value ? e : n.placeholder) }) : null,
134
- /* @__PURE__ */ r(
137
+ t ? /* @__PURE__ */ n("span", { className: `${o}-view-value-mirror`, children: ye(s.value ? e : s.placeholder) }) : null,
138
+ /* @__PURE__ */ n(
135
139
  "span",
136
140
  {
137
141
  style: t ? { display: "none" } : {},
138
142
  className: `${o}-view-value`,
139
- children: be(G ? n.placeholder : e)
143
+ children: ye(K ? s.placeholder : e)
140
144
  }
141
145
  )
142
146
  ] });
143
- }, ee = Qe(le), Fe = ze(() => {
147
+ }, ae = io(fe), ve = T(a) ? a.count : a, we = (e) => {
148
+ const t = ae(e);
149
+ return { value: e, label: t.text, closable: !t.disabled };
150
+ }, le = Ye(() => {
144
151
  if (!I)
145
152
  return [];
146
- const e = we(w) ? [] : [].concat(w), t = [], n = C(s) ? s.count : s, oe = typeof n == "number";
147
- for (let D = 0; D < e.length && !(oe && t.length >= n + no); D++) {
148
- const te = e[D], a = ee(te);
149
- t.push({
150
- value: te,
151
- label: a.text,
152
- closable: !a.disabled
153
- });
154
- }
155
- return t;
156
- }, [w, I, s, ee]), Re = () => {
157
- const e = we(w) ? [] : [].concat(w), t = C(s) ? s.count : s, n = (a) => {
158
- const u = C(s) && _e(s.render) ? s.render(a) : `+${a}...`;
159
- return ie ? u : /* @__PURE__ */ r(
160
- eo,
161
- {
162
- className: N(`${de("input-tag")}-tag`, `${o}-tag`),
163
- children: u
164
- }
165
- );
166
- }, oe = () => {
167
- for (let a = e.length - 1; a >= 0; a--) {
168
- const u = e[a];
169
- if (!ee(u).disabled)
170
- return a;
153
+ const e = $e(C) ? [] : [].concat(C);
154
+ return (Se(ve) ? e.slice(0, ve) : e).map((_) => we(_));
155
+ }, [C, I, a, ae]), Le = () => {
156
+ const e = T(a) ? a.count : a, t = T(a) && a.showPopover, s = me("input-tag"), _ = (r) => T(a) && so(a.render) ? a.render(r) : e === "responsive" ? /* @__PURE__ */ k(
157
+ Te,
158
+ {
159
+ className: `${s}-tag`,
160
+ children: [
161
+ "+",
162
+ r,
163
+ "..."
164
+ ]
165
+ },
166
+ ie
167
+ ) : `+${r}...`, N = $e(C) ? [] : [].concat(C), Ge = () => {
168
+ for (let r = N.length - 1; r >= 0; r--) {
169
+ const c = N[r];
170
+ if (!ae(c).disabled)
171
+ return r;
171
172
  }
172
173
  return -1;
173
- }, D = {
174
- onPaste: i.paste,
175
- onKeyDown: i.keyDown,
176
- onFocus: i.focus,
177
- onBlur: i.blur,
178
- onInputChange: i.change,
179
- onRemove: (a, u, re) => {
180
- const Oe = re.key;
181
- let ne = -1;
182
- Oe === ro.key && (ne = oe()) !== -1 && (a = e[ne], u = ne), s && ke(), q == null || q(a, u, re);
174
+ }, xe = {
175
+ onPaste: u.paste,
176
+ onKeyDown: u.keyDown,
177
+ onFocus: u.focus,
178
+ onBlur: u.blur,
179
+ onInputChange: u.change,
180
+ onRemove: (r, c, d) => {
181
+ const p = d.key;
182
+ let l = -1;
183
+ p === go.key && (l = Ge()) !== -1 && (r = N[l], c = l), a && Me(), ee == null || ee(r, c, d);
183
184
  }
184
- };
185
- return /* @__PURE__ */ r(
186
- Xe,
185
+ }, Ke = {
186
+ suffix: null,
187
+ prefix: null,
188
+ addBefore: null,
189
+ addAfter: null,
190
+ allowClear: !1,
191
+ labelInValue: !1
192
+ }, Ne = (() => {
193
+ if (Se(e)) {
194
+ const r = N.length - e;
195
+ if (r > 0) {
196
+ const c = {
197
+ label: _(r),
198
+ closable: !1,
199
+ // InputTag needs to extract value as key
200
+ value: ie
201
+ };
202
+ if (t) {
203
+ const d = N.map((p, l) => ({ val: p, index: l })).slice(e).map((p) => {
204
+ const l = we(p.val);
205
+ return X ? X(
206
+ { ...l, onClose: () => {
207
+ } },
208
+ p.index,
209
+ le.concat(c)
210
+ ) : /* @__PURE__ */ Ze(
211
+ Te,
212
+ {
213
+ ...l,
214
+ key: l.value,
215
+ className: `${s}-tag`,
216
+ onClose: (ce) => xe.onRemove(l.value, p.index, ce)
217
+ },
218
+ l.label
219
+ );
220
+ });
221
+ c.label = /* @__PURE__ */ n(po, { content: !!d.length && /* @__PURE__ */ n(Xe, { children: d }), children: c.label });
222
+ }
223
+ return c;
224
+ }
225
+ }
226
+ })(), qe = Ne ? le.concat(Ne) : le;
227
+ return /* @__PURE__ */ n(
228
+ uo,
187
229
  {
188
- ...{
189
- suffix: null,
190
- prefix: null,
191
- addBefore: null,
192
- addAfter: null,
193
- allowClear: !1,
194
- labelInValue: !1
195
- },
196
- className: Q ? `${de("input-tag")}-focus` : "",
197
- ref: S,
198
- disabled: l,
199
- dragToSort: ce,
200
- disableInput: !T,
230
+ ...Ke,
231
+ className: re ? `${me("input-tag")}-focus` : "",
232
+ ref: D,
233
+ disabled: i,
234
+ dragToSort: pe,
235
+ disableInput: !P,
201
236
  animation: V,
202
- placeholder: ae,
203
- value: Fe,
204
- inputValue: j,
205
- size: A,
237
+ placeholder: de,
238
+ value: qe,
239
+ inputValue: G,
240
+ size: B,
206
241
  tagClassName: `${o}-tag`,
207
- renderTag: ie,
208
- icon: { removeIcon: P },
209
- maxTagCount: s ? {
210
- count: C(s) ? s.count : s,
211
- render: t === "responsive" ? n : () => n(e.length - t),
212
- popoverProps: { disabled: !0 }
242
+ renderTag: X,
243
+ icon: { removeIcon: O },
244
+ maxTagCount: e === "responsive" ? {
245
+ count: e,
246
+ render: _,
247
+ popoverProps: t ? {} : { disabled: !0 }
213
248
  } : void 0,
214
- onChange: (a, u) => {
215
- ue && u === "sort" && ue(a);
249
+ onChange: (r, c) => {
250
+ if (oe && c === "sort") {
251
+ const d = r.indexOf(
252
+ ie
253
+ );
254
+ if (d > -1) {
255
+ const p = r.slice(0, d), l = r.slice(d + 1), ce = N.slice(
256
+ r.length - 1 - N.length
257
+ );
258
+ oe(p.concat(ce, l));
259
+ } else
260
+ oe(r);
261
+ }
216
262
  },
217
- ...D
263
+ ...xe
218
264
  }
219
265
  );
220
- }, he = z || (d.error ? "error" : void 0), Be = !l && !G && k ? /* @__PURE__ */ r(
221
- qe,
266
+ }, Ce = H || (m.error ? "error" : void 0), je = !i && !K && F ? /* @__PURE__ */ n(
267
+ lo,
222
268
  {
223
- size: A,
269
+ size: B,
224
270
  className: `${o}-clear-icon`,
225
- onClick: ye,
226
- onMouseDown: X,
227
- children: m ?? /* @__PURE__ */ r(He, {})
271
+ onClick: Re,
272
+ onMouseDown: ne,
273
+ children: b ?? /* @__PURE__ */ n(oo, {})
228
274
  },
229
275
  "clearIcon"
230
- ) : null, Me = N(
276
+ ) : null, He = A(
231
277
  o,
232
278
  `${o}-${I ? "multiple" : "single"}`,
233
279
  {
234
- [`${o}-show-search`]: T,
235
- [`${o}-open`]: h,
236
- [`${o}-size-${A}`]: A,
237
- [`${o}-focused`]: Q,
238
- [`${o}-${he}`]: he,
239
- [`${o}-disabled`]: l,
240
- [`${o}-no-border`]: !W,
241
- [`${o}-rtl`]: Ce
280
+ [`${o}-show-search`]: P,
281
+ [`${o}-open`]: v,
282
+ [`${o}-size-${B}`]: B,
283
+ [`${o}-focused`]: re,
284
+ [`${o}-${Ce}`]: Ce,
285
+ [`${o}-disabled`]: i,
286
+ [`${o}-no-border`]: !j,
287
+ [`${o}-rtl`]: ke
242
288
  },
243
- U
289
+ L
244
290
  );
245
- return /* @__PURE__ */ r(
291
+ return /* @__PURE__ */ n(
246
292
  "div",
247
293
  {
248
294
  role: "combobox",
249
295
  "aria-haspopup": "listbox",
250
296
  "aria-autocomplete": "list",
251
- "aria-expanded": h,
252
- "aria-disabled": l,
253
- "aria-controls": Ne,
254
- ...oo(Se, ["onClick", "onMouseEnter", "onMouseLeave"]),
255
- ...xe,
256
- ref: g,
257
- tabIndex: l ? -1 : 0,
258
- id: M,
259
- style: O,
260
- className: Me,
261
- onKeyDown: me,
297
+ "aria-expanded": v,
298
+ "aria-disabled": i,
299
+ "aria-controls": Pe,
300
+ ...mo(Ve, ["onClick", "onMouseEnter", "onMouseLeave"]),
301
+ ...Ae,
302
+ ref: w,
303
+ tabIndex: i ? -1 : 0,
304
+ id: W,
305
+ style: z,
306
+ className: He,
307
+ onKeyDown: be,
262
308
  onFocus: (e) => {
263
- !l && !ce && (c ? S.current && S.current.focus() : F("focus", e));
309
+ !i && !pe && (f ? D.current && D.current.focus() : M("focus", e));
264
310
  },
265
- onBlur: (e) => F("blur", e),
266
- children: /* @__PURE__ */ R(
311
+ onBlur: (e) => M("blur", e),
312
+ children: /* @__PURE__ */ k(
267
313
  "div",
268
314
  {
269
- title: typeof b == "string" ? b : void 0,
270
- className: N(`${o}-view`, {
271
- [`${o}-view-with-prefix`]: H
315
+ title: typeof x == "string" ? x : void 0,
316
+ className: A(`${o}-view`, {
317
+ [`${o}-view-with-prefix`]: q
272
318
  }),
273
- onClick: (e) => h && c && e.stopPropagation(),
319
+ onClick: (e) => v && f && e.stopPropagation(),
274
320
  children: [
275
- H && /* @__PURE__ */ r(
321
+ q && /* @__PURE__ */ n(
276
322
  "div",
277
323
  {
278
324
  "aria-hidden": "true",
279
- className: N(`${o}-prefix`),
280
- onMouseDown: (e) => J && X(e),
281
- children: H
325
+ className: A(`${o}-prefix`),
326
+ onMouseDown: (e) => te && ne(e),
327
+ children: q
282
328
  }
283
329
  ),
284
- I ? Re() : Ae(),
285
- /* @__PURE__ */ R(
330
+ I ? Le() : ze(),
331
+ /* @__PURE__ */ k(
286
332
  "div",
287
333
  {
288
334
  "aria-hidden": "true",
289
335
  className: `${o}-suffix`,
290
- onMouseDown: (e) => J && X(e),
336
+ onMouseDown: (e) => te && ne(e),
291
337
  children: [
292
- Be,
293
- Pe
338
+ je,
339
+ We
294
340
  ]
295
341
  }
296
342
  )
@@ -299,63 +345,63 @@ const v = {
299
345
  )
300
346
  }
301
347
  );
302
- }), ao = (B, d) => {
348
+ }), vo = (U, m) => {
303
349
  const {
304
- prefixCls: x,
305
- id: M,
306
- style: O,
307
- className: U,
308
- addBefore: $,
309
- rtl: W,
310
- renderView: k,
311
- autoWidth: y,
312
- ...z
313
- } = B, E = y ? {
350
+ prefixCls: y,
351
+ id: W,
352
+ style: z,
353
+ className: L,
354
+ addBefore: S,
355
+ rtl: j,
356
+ renderView: F,
357
+ autoWidth: E,
358
+ ...H
359
+ } = U, R = E ? {
314
360
  minWidth: 0,
315
361
  maxWidth: "100%",
316
- ...C(y) ? y : {}
317
- } : null, l = se(null), V = $ != null, f = V || !1, p = {
318
- id: M,
319
- style: { ...E, width: E ? "auto" : void 0, ...O },
320
- className: U
321
- }, P = je(z);
322
- ve(
323
- d,
324
- () => l.current
362
+ ...T(E) ? E : {}
363
+ } : null, i = ue(null), V = S != null, h = V || !1, g = {
364
+ id: W,
365
+ style: { ...R, width: R ? "auto" : void 0, ...z },
366
+ className: L
367
+ }, O = eo(H);
368
+ De(
369
+ m,
370
+ () => i.current
325
371
  );
326
- let m = /* @__PURE__ */ r(
327
- so,
372
+ let b = /* @__PURE__ */ n(
373
+ bo,
328
374
  {
329
- ...B,
330
- ref: l,
331
- id: f ? void 0 : p.id,
332
- style: f ? void 0 : p.style,
333
- className: f ? void 0 : p.className,
334
- htmlDataAttributes: f ? {} : P
375
+ ...U,
376
+ ref: i,
377
+ id: h ? void 0 : g.id,
378
+ style: h ? void 0 : g.style,
379
+ className: h ? void 0 : g.className,
380
+ htmlDataAttributes: h ? {} : O
335
381
  }
336
382
  );
337
- return typeof k == "function" && (m = k(m)), f ? /* @__PURE__ */ R(
383
+ return typeof F == "function" && (b = F(b)), h ? /* @__PURE__ */ k(
338
384
  "div",
339
385
  {
340
- ...P,
341
- ...p,
342
- className: N(
343
- `${x}-wrapper`,
386
+ ...O,
387
+ ...g,
388
+ className: A(
389
+ `${y}-wrapper`,
344
390
  {
345
- [`${x}-wrapper-rtl`]: W
391
+ [`${y}-wrapper-rtl`]: j
346
392
  },
347
- p.className
393
+ g.className
348
394
  ),
349
395
  children: [
350
- V && /* @__PURE__ */ r("div", { className: `${x}-addbefore`, children: $ }),
351
- m
396
+ V && /* @__PURE__ */ n("div", { className: `${y}-addbefore`, children: S }),
397
+ b
352
398
  ]
353
399
  }
354
- ) : m;
355
- }, lo = Ie.forwardRef(
356
- ao
400
+ ) : b;
401
+ }, wo = Ee.forwardRef(
402
+ vo
357
403
  );
358
- lo.displayName = "SelectView";
404
+ wo.displayName = "SelectView";
359
405
  export {
360
- lo as default
406
+ wo as default
361
407
  };