@unicom-cloud/ui 0.8.63 → 0.8.65

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 (214) hide show
  1. package/Affix.js +2 -2
  2. package/Alert.js +2 -2
  3. package/Anchor.js +1 -1
  4. package/AutoComplete.js +4 -4
  5. package/Avatar.js +2 -2
  6. package/BackTop.js +2 -2
  7. package/Badge.js +37 -31
  8. package/Breadcrumb.js +3 -3
  9. package/Button.js +82 -71
  10. package/Calendar.js +4 -4
  11. package/Card.js +2 -2
  12. package/Carousel.js +2 -2
  13. package/Cascader.js +1 -1
  14. package/Checkbox.js +1 -1
  15. package/Collapse.js +1 -1
  16. package/ColorPicker.js +5 -5
  17. package/Comment.js +2 -2
  18. package/ConfigProvider.js +2 -2
  19. package/Copy.js +3 -3
  20. package/DatePicker.js +92 -92
  21. package/Descriptions.js +2 -2
  22. package/Divider.js +2 -2
  23. package/Draggable.js +2 -2
  24. package/Drawer.js +1 -1
  25. package/Dropdown.js +27 -26
  26. package/Empty.js +2 -2
  27. package/Form.js +4 -4
  28. package/Grid.js +3 -3
  29. package/Icon.js +3 -2
  30. package/IconHover.js +2 -2
  31. package/Image.js +4 -1
  32. package/Input.js +11 -2
  33. package/InputNumber.js +3 -3
  34. package/InputTag.js +1 -1
  35. package/Layout.js +25 -21
  36. package/Link.js +2 -2
  37. package/List.js +31 -30
  38. package/Mentions.js +4 -4
  39. package/Menu.js +7 -2
  40. package/Message.js +4 -3
  41. package/Modal.js +1 -1
  42. package/Notice.js +2 -2
  43. package/Notification.js +4 -3
  44. package/OverflowEllipsis.js +2 -2
  45. package/PageHeader.js +2 -2
  46. package/Pagination.js +1 -1
  47. package/Picker.js +1 -1
  48. package/Popconfirm.js +2 -2
  49. package/Popover.js +2 -2
  50. package/Progress.js +2 -2
  51. package/Radio.js +4 -2
  52. package/Rate.js +2 -2
  53. package/ResizeBox.js +140 -137
  54. package/Result.js +2 -2
  55. package/Select.js +4 -1
  56. package/SelectView.js +7 -7
  57. package/Skeleton.js +2 -2
  58. package/Slider.js +5 -5
  59. package/Space.js +54 -50
  60. package/Spin.js +2 -2
  61. package/Statistic.js +29 -28
  62. package/Steps.js +41 -39
  63. package/Switch.js +3 -3
  64. package/Table.js +8 -5
  65. package/Tabs.js +6 -2
  66. package/Tag.js +2 -2
  67. package/TimePicker.js +38 -37
  68. package/Timeline.js +4 -2
  69. package/Tooltip.js +2 -2
  70. package/Transfer.js +4 -4
  71. package/Tree.js +1 -1
  72. package/TreeSelect.js +3 -1
  73. package/Trigger.js +43 -42
  74. package/Typography.js +6 -2
  75. package/Upload.js +3 -3
  76. package/VerificationCode.js +1 -1
  77. package/Version.js +5 -3
  78. package/Watermark.js +1 -1
  79. package/chunk/{DDDuw0Zi.js → 1GQdnTJp.js} +2 -2
  80. package/chunk/BAWsPQBM.js +11 -0
  81. package/chunk/{CfZWOhnc.js → BS09tn7B.js} +2 -2
  82. package/chunk/{CZ1wrD_H.js → BUCEs557.js} +2 -2
  83. package/chunk/BqGtwxTi.js +777 -0
  84. package/chunk/{BcwdVUDs.js → Bqk6yh16.js} +2 -2
  85. package/chunk/{CD7dGcUa.js → BqufsN8i.js} +4 -4
  86. package/chunk/{Dpzgtdt-.js → BtlvlGQN.js} +2 -2
  87. package/chunk/{BoDdbbF_.js → CF6p9R93.js} +4 -3
  88. package/chunk/{BnLshM9R.js → CGZ0In1p.js} +189 -182
  89. package/chunk/{B5gIo-hD.js → CH1UUxsg.js} +4 -4
  90. package/chunk/{D3dcFbex.js → CIlGCedk.js} +3 -3
  91. package/chunk/{CgDayZDE.js → CPcm9Cm5.js} +2 -2
  92. package/chunk/{Cqyp4qni.js → CSC_V_25.js} +45 -45
  93. package/chunk/{JpKOcIfl.js → CWgltRVL.js} +44 -41
  94. package/chunk/{BLLKKgZJ.js → CsbCHnFk.js} +23 -21
  95. package/chunk/{Cb_oWoGj.js → CwhPMMWy.js} +14 -14
  96. package/chunk/{B9w_puFP.js → DG-epQqF.js} +2 -2
  97. package/chunk/{QFkhCtUr.js → DIx0qmCq.js} +3 -3
  98. package/chunk/{Bn2-vqTg.js → DK4KcodH.js} +201 -195
  99. package/chunk/{BEB_A9eY.js → DLvMA1OW.js} +2 -2
  100. package/chunk/{DbPYtS7-.js → DQDkV47j.js} +2 -2
  101. package/chunk/{rlfmXePI.js → DTjcKyDN.js} +135 -134
  102. package/chunk/{BmO1y0vr.js → DUeHQKtx.js} +12 -12
  103. package/chunk/{C6Zb_-OE.js → DXZEpA3t.js} +2 -2
  104. package/chunk/{aqSmxUbY.js → DjtWv6Wn.js} +1 -1
  105. package/chunk/{C5S_amaH.js → DlLL5JQo.js} +106 -101
  106. package/chunk/{CvlD3aiv.js → Dnycc1qJ.js} +133 -130
  107. package/chunk/{DbLgopUR.js → DqFhzTWC.js} +3 -3
  108. package/chunk/{DXZ8-ha7.js → Dv_xRzvR.js} +3 -3
  109. package/chunk/{Dk6hL04k.js → Ek8U5CTN.js} +222 -221
  110. package/chunk/{CfTcP6nF.js → ewRDIDUz.js} +4 -4
  111. package/chunk/{CAxIyiy6.js → tYXLFPVI.js} +6 -4
  112. package/hooks/useIntersectionObserver.js +1 -1
  113. package/hooks/useMergeValue.js +2 -2
  114. package/index.js +530 -476
  115. package/locale/en-US.js +1 -1
  116. package/locale/tr-TR.js +1 -1
  117. package/package.json +1 -1
  118. package/style/variable.less +820 -0
  119. package/style.css +1 -1
  120. package/types/badge/index.d.ts +2 -2
  121. package/types/button/index.d.ts +3 -1
  122. package/types/calendar/hook/useCellClassName.d.ts +2 -1
  123. package/types/checkbox/IconCheck.d.ts +2 -1
  124. package/types/config-provider/interface.d.ts +1 -1
  125. package/types/date-picker/hook/useCellClassName.d.ts +2 -1
  126. package/types/date-picker/panel/Footer.d.ts +2 -1
  127. package/types/dropdown/index.d.ts +1 -0
  128. package/types/form/IconSymbol.d.ts +2 -1
  129. package/types/form/useForm.d.ts +2 -1
  130. package/types/icon/addFromIconFontCn.d.ts +2 -1
  131. package/types/icon/index.d.ts +2 -0
  132. package/types/image/Image.d.ts +1 -0
  133. package/types/image/index.d.ts +2 -1
  134. package/types/image/util/getFixTranslate.d.ts +2 -1
  135. package/types/image/util/hook/useImageStatus.d.ts +2 -2
  136. package/types/image/util/hook/useShowFooter.d.ts +2 -2
  137. package/types/index.d.ts +26 -26
  138. package/types/input/Input.d.ts +1 -0
  139. package/types/input/index.d.ts +1 -0
  140. package/types/input/useComposition.d.ts +2 -1
  141. package/types/input-number/useSelectionRange.d.ts +2 -1
  142. package/types/layout/index.d.ts +1 -0
  143. package/types/list/index.d.ts +1 -0
  144. package/types/menu/Indent.d.ts +2 -1
  145. package/types/menu/Menu.d.ts +1 -0
  146. package/types/menu/index.d.ts +1 -0
  147. package/types/message/index.d.ts +2 -0
  148. package/types/notification/index.d.ts +2 -0
  149. package/types/overflow-ellipsis/OverflowItem.d.ts +2 -2
  150. package/types/overflow-ellipsis/index.d.ts +2 -2
  151. package/types/radio/Radio.d.ts +2 -0
  152. package/types/radio/index.d.ts +2 -1
  153. package/types/resize-box/ResizeTrigger.d.ts +2 -1
  154. package/types/resize-box/index.d.ts +1 -0
  155. package/types/result/403.d.ts +2 -1
  156. package/types/result/404.d.ts +2 -1
  157. package/types/result/500.d.ts +2 -1
  158. package/types/select/Select.d.ts +1 -1
  159. package/types/select/index.d.ts +1 -0
  160. package/types/select/interface.d.ts +1 -1
  161. package/types/skeleton/Image.d.ts +2 -1
  162. package/types/skeleton/Text.d.ts +2 -1
  163. package/types/slider/hook/useLegalValue.d.ts +2 -1
  164. package/types/space/index.d.ts +2 -0
  165. package/types/space/toArray.d.ts +2 -1
  166. package/types/speech-synthesis/index.d.ts +2 -1
  167. package/types/spin/DotLoading.d.ts +2 -1
  168. package/types/statistic/index.d.ts +1 -0
  169. package/types/steps/index.d.ts +1 -0
  170. package/types/table/hook/useComponent.d.ts +2 -1
  171. package/types/table/hook/useExpand.d.ts +2 -1
  172. package/types/table/hook/useRowSelection.d.ts +2 -1
  173. package/types/table/hook/useSorter.d.ts +2 -1
  174. package/types/table/index.d.ts +2 -1
  175. package/types/table/summary/index.d.ts +3 -0
  176. package/types/tabs/Tab.d.ts +1 -0
  177. package/types/tabs/TabContent.d.ts +2 -2
  178. package/types/tabs/hook/useDomSize.d.ts +2 -1
  179. package/types/tabs/hook/useHeaderScroll.d.ts +2 -1
  180. package/types/tabs/index.d.ts +1 -0
  181. package/types/tabs/tab-header/DropdownIcon.d.ts +2 -1
  182. package/types/time-picker/TimeColumn.d.ts +2 -2
  183. package/types/time-picker/index.d.ts +5 -0
  184. package/types/timeline/Timeline.d.ts +1 -0
  185. package/types/timeline/index.d.ts +1 -0
  186. package/types/tree-select/Select.d.ts +5 -0
  187. package/types/tree-select/hook/useTreeData.d.ts +2 -1
  188. package/types/tree-select/index.d.ts +2 -1
  189. package/types/typography/Operations.d.ts +2 -1
  190. package/types/typography/index.d.ts +1 -0
  191. package/types/upload/Upload.d.ts +2 -1
  192. package/types/upload/index.d.ts +2 -3
  193. package/types/utils/fillNBSP.d.ts +2 -1
  194. package/types/utils/getHighlightText.d.ts +2 -1
  195. package/types/utils/getHotkeyHandler.d.ts +2 -1
  196. package/types/utils/getStringLength.d.ts +2 -1
  197. package/types/utils/include.d.ts +2 -1
  198. package/types/utils/mergeProps.d.ts +2 -1
  199. package/types/utils/mergedToString.d.ts +2 -1
  200. package/types/utils/omit.d.ts +2 -1
  201. package/types/utils/pick.d.ts +2 -1
  202. package/types/utils/throttleByRaf.d.ts +2 -1
  203. package/types/utils/throttleByRafV2.d.ts +2 -1
  204. package/types/utils/warning.d.ts +2 -1
  205. package/types/version/index.d.ts +2 -0
  206. package/utils/className.js +1 -1
  207. package/utils/contextHolder.js +1 -1
  208. package/utils/copy.js +1 -1
  209. package/utils/index.js +41 -41
  210. package/utils/is.js +37 -37
  211. package/utils/reactDOM.js +3 -3
  212. package/utils/scrollIntoView.js +1 -1
  213. package/chunk/BzPkh4Zv.js +0 -11
  214. package/chunk/Co3idurS.js +0 -774
@@ -0,0 +1,777 @@
1
+ import { jsx as E, jsxs as st } from "react/jsx-runtime";
2
+ import ee from "lodash/isArray";
3
+ import St from "lodash/isFunction";
4
+ import te, { useContext as Vt, useState as _e, useMemo as et, useRef as j, useCallback as Ue, useEffect as K, useImperativeHandle as At } from "react";
5
+ import { C as lt } from "./DG-epQqF.js";
6
+ import { d as Et } from "./DlLL5JQo.js";
7
+ import { useId as Lt } from "../hooks/useId.js";
8
+ import { useMergeProps as $t } from "../hooks/useMergeProps.js";
9
+ import { useMergeValue as tt } from "../hooks/useMergeValue.js";
10
+ import It from "../SelectView.js";
11
+ import Nt from "../Trigger.js";
12
+ import { y as fe } from "./BAWsPQBM.js";
13
+ import Tt from "../utils/getHotkeyHandler.js";
14
+ import "../utils/is.js";
15
+ import { d as Pt, E as nt, T as rt, c as Ft, A as Ut } from "./C2lIz2F9.js";
16
+ import Me from "../utils/omit.js";
17
+ import Rt from "../utils/warning.js";
18
+ import { V as Mt } from "./D3NFxdmG.js";
19
+ import { z as Dt } from "./CSC_V_25.js";
20
+ import ie from "lodash/get";
21
+ import Gt from "lodash/isNil";
22
+ import Ht from "lodash/isNumber";
23
+ import Re from "lodash/isPlainObject";
24
+ import jt from "lodash/isString";
25
+ import Kt from "../utils/fillNBSP.js";
26
+ import Bt from "../utils/getHighlightText.js";
27
+ import U from "lodash/isPlainObject.js";
28
+ function Qt(l, v) {
29
+ const { prefixCls: x, label: O, ...R } = l;
30
+ return /* @__PURE__ */ E(
31
+ "li",
32
+ {
33
+ ref: v,
34
+ className: `${x}-group-title`,
35
+ ...Me(R, ["_key", "children", "isSelectOptGroup"]),
36
+ children: O
37
+ }
38
+ );
39
+ }
40
+ const Wt = te.forwardRef(Qt), at = Wt;
41
+ at.__PQB_SELECT_OPTGROUP__ = !0;
42
+ function qt(l, v) {
43
+ const {
44
+ style: x,
45
+ className: O,
46
+ wrapperClassName: R,
47
+ disabled: P,
48
+ prefixCls: u,
49
+ rtl: L,
50
+ value: M,
51
+ children: D,
52
+ _isMultipleMode: J,
53
+ _isUserCreatedOption: B,
54
+ _isUserCreatingOption: w,
55
+ _valueActive: G,
56
+ _valueSelect: Q,
57
+ _onMouseEnter: $,
58
+ _onMouseLeave: H,
59
+ _onClick: k,
60
+ ...o
61
+ } = l, f = "value" in l ? M : `${D}`, a = "children" in l ? D : `${M}`, s = J ? Q.indexOf(f) !== -1 : Q === f, b = {
62
+ style: x,
63
+ className: fe(
64
+ `${u}-option`,
65
+ {
66
+ [`${u}-option-selected`]: s,
67
+ [`${u}-option-disabled`]: P,
68
+ [`${u}-option-hover`]: f === G,
69
+ [`${u}-option-empty`]: !a && a !== 0 || typeof a == "string" && /^\s*$/.test(a),
70
+ [`${u}-option-rtl`]: L
71
+ },
72
+ O
73
+ ),
74
+ onMouseEnter: (I) => {
75
+ var y;
76
+ $ == null || $(f), (y = o.onMouseEnter) == null || y.call(o, I);
77
+ },
78
+ onMouseLeave: (I) => {
79
+ var y;
80
+ H == null || H(), (y = o.onMouseLeave) == null || y.call(o, I);
81
+ },
82
+ onClick: (I) => {
83
+ var y;
84
+ k == null || k(f, P), (y = o.onClick) == null || y.call(o, I);
85
+ },
86
+ ...Me(o, [
87
+ "_key",
88
+ "extra",
89
+ "isSelectOption",
90
+ "onClick",
91
+ "onMouseEnter",
92
+ "onMouseLeave"
93
+ ])
94
+ }, h = {
95
+ ref: v,
96
+ role: "option",
97
+ "aria-selected": s
98
+ };
99
+ return B && Object.assign(h, { "data-user-created": !0 }), w && Object.assign(h, { "data-user-creating": !0 }), J ? /* @__PURE__ */ st(
100
+ "li",
101
+ {
102
+ ...h,
103
+ className: fe(
104
+ `${u}-option-wrapper`,
105
+ {
106
+ [`${u}-option-wrapper-selected`]: s,
107
+ [`${u}-option-wrapper-disabled`]: P
108
+ },
109
+ R
110
+ ),
111
+ children: [
112
+ /* @__PURE__ */ E(
113
+ lt,
114
+ {
115
+ "aria-hidden": "true",
116
+ className: `${u}-checkbox`,
117
+ checked: s,
118
+ disabled: P,
119
+ onChange: b.onClick
120
+ }
121
+ ),
122
+ /* @__PURE__ */ E("span", { ...b, children: a })
123
+ ]
124
+ }
125
+ ) : /* @__PURE__ */ E("li", { ...h, ...b, children: a });
126
+ }
127
+ const Jt = te.forwardRef(qt), De = Jt;
128
+ De.__PQB_SELECT_OPTION__ = !0;
129
+ function Xt(l) {
130
+ l && l.preventDefault();
131
+ }
132
+ function be(l, v) {
133
+ return v ? !ee(l) || Dt(l) : Gt(l);
134
+ }
135
+ function ot(l, v, x) {
136
+ return x && (v ? l = Array.isArray(l) ? l.map(
137
+ (O) => Re(O) && "label" in O ? O.value : O
138
+ ) : l : l = Re(l) && "label" in l ? l.value : l), be(l, v) ? v ? Array.isArray(l) ? l : [] : void 0 : l;
139
+ }
140
+ function ut(l) {
141
+ return ie(l, "props.isSelectOption") || ie(l, "type.__PQB_SELECT_OPTION__");
142
+ }
143
+ function pt(l) {
144
+ return ie(l, "props.isSelectOptGroup") || ie(l, "type.__PQB_SELECT_OPTGROUP__");
145
+ }
146
+ function ct({
147
+ children: l,
148
+ options: v,
149
+ filterOption: x
150
+ }, {
151
+ inputValue: O = "",
152
+ userCreatedOptions: R,
153
+ userCreatingOption: P,
154
+ prefixCls: u
155
+ }, {
156
+ optionInfoMap: L = /* @__PURE__ */ new Map(),
157
+ optionValueList: M = [],
158
+ customNodeCount: D = 0
159
+ } = {}) {
160
+ let J = !1, B = !1, w = [], G = [];
161
+ const Q = (o) => {
162
+ const f = ie(o, "props.value"), a = ie(o, "props.children");
163
+ return f === void 0 && a !== null && a !== void 0 ? a.toString() : f;
164
+ }, $ = ({ label: o, value: f }, a, s) => !o && !f && !a ? (D++, `custom_node_${D}`) : s ? a || `group_${o}` : a || `${typeof f}_${f}` || `${o}_${L.size}`, H = (o, f, a) => {
165
+ const s = Q(o);
166
+ let b = !0;
167
+ x === !0 ? b = s !== void 0 && String(s).toLowerCase().indexOf(O.toLowerCase()) !== -1 : typeof x == "function" && (b = !O || x(O, o, a));
168
+ const h = L.get(s), I = (h == null ? void 0 : h._origin) === "userCreatedOptions" || (h == null ? void 0 : h._origin) === "userCreatingOption";
169
+ if (!h || I) {
170
+ "_key" in o.props || (o = te.cloneElement(o, {
171
+ _key: $(o.props, o.key)
172
+ }));
173
+ const y = L.size, se = {
174
+ child: o,
175
+ ...o.props,
176
+ value: s,
177
+ _index: y,
178
+ _origin: f,
179
+ _valid: b
180
+ };
181
+ if (L.set(s, se), I) {
182
+ const le = w.findIndex(
183
+ (ae) => {
184
+ var ne;
185
+ return ((ne = ae == null ? void 0 : ae.props) == null ? void 0 : ne.value) === s;
186
+ }
187
+ );
188
+ le > -1 && (b ? w[le] = o : w.splice(le, 1));
189
+ } else
190
+ M.push(s), b && (w.push(o), se.disabled || G.push(y));
191
+ }
192
+ typeof o.props.children != "string" && (B = !0);
193
+ }, k = (o, f) => {
194
+ f && ee(o) && o.length && o.forEach((a) => {
195
+ (jt(a) || Ht(a)) && (a = {
196
+ label: a,
197
+ value: a
198
+ });
199
+ const s = /* @__PURE__ */ E(
200
+ De,
201
+ {
202
+ _key: $(a),
203
+ value: a.value,
204
+ disabled: a.disabled === !0,
205
+ extra: a.extra,
206
+ children: Kt(a.label)
207
+ }
208
+ );
209
+ H(s, f, a);
210
+ });
211
+ };
212
+ return P && k([P], "userCreatingOption"), l && te.Children.map(l, (o) => {
213
+ if (pt(o)) {
214
+ const { children: f, options: a } = o.props, {
215
+ childrenList: s,
216
+ optionIndexListForArrowKey: b,
217
+ hasComplexLabelInOptions: h
218
+ } = ct(
219
+ { children: f, options: a, filterOption: x },
220
+ { inputValue: O, prefixCls: u },
221
+ { optionInfoMap: L, optionValueList: M, customNodeCount: D }
222
+ );
223
+ s.length && (w.push(
224
+ te.cloneElement(o, {
225
+ children: null,
226
+ _key: $(o.props, o.key, !0)
227
+ })
228
+ ), w = w.concat(s), G = G.concat(
229
+ b
230
+ ), J = !0, B = B || h);
231
+ } else ut(o) ? H(o, "children", null) : Re(o) && o.props && w.push(
232
+ te.cloneElement(o, {
233
+ _key: $(o.props, o.key)
234
+ })
235
+ );
236
+ }), k(v, "options"), k(R, "userCreatedOptions"), {
237
+ childrenList: Bt({
238
+ nodeList: w,
239
+ pattern: O,
240
+ highlightClassName: `${u}-highlight`
241
+ }),
242
+ optionInfoMap: L,
243
+ optionValueList: M,
244
+ optionIndexListForArrowKey: G,
245
+ hasOptGroup: J,
246
+ hasComplexLabelInOptions: B
247
+ };
248
+ }
249
+ const it = "userCreatingOption", Yt = {
250
+ trigger: "click",
251
+ bordered: !0,
252
+ filterOption: !0,
253
+ unmountOnExit: !0,
254
+ defaultActiveFirstOption: !0,
255
+ allowCheckAll: !0
256
+ }, Zt = { bottom: 4 };
257
+ function zt(l, v) {
258
+ var Ye;
259
+ const { getPrefixCls: x, renderEmpty: O, componentConfig: R, rtl: P } = Vt(Et), u = $t(
260
+ l,
261
+ Yt,
262
+ R == null ? void 0 : R.Select
263
+ ), {
264
+ children: L,
265
+ renderFormat: M,
266
+ defaultActiveFirstOption: D,
267
+ disabled: J,
268
+ unmountOnExit: B,
269
+ notFoundContent: w,
270
+ showSearch: G,
271
+ tokenSeparators: Q,
272
+ options: $,
273
+ filterOption: H,
274
+ labelInValue: k,
275
+ getPopupContainer: o,
276
+ trigger: f,
277
+ triggerElement: a,
278
+ triggerProps: s,
279
+ dropdownRender: b,
280
+ dropdownMenuStyle: h,
281
+ dropdownMenuClassName: I,
282
+ virtualListProps: y,
283
+ // events
284
+ onChange: se,
285
+ onSelect: le,
286
+ onDeselect: ae,
287
+ onClear: ne,
288
+ onSearch: ve,
289
+ onFocus: dt,
290
+ onBlur: we,
291
+ onPopupScroll: xe,
292
+ onVisibleChange: ke,
293
+ onInputValueChange: Se,
294
+ onPaste: Ve,
295
+ onKeyDown: Ae
296
+ } = u;
297
+ let { mode: Ee, allowCheckAll: He, allowCreate: _ } = u;
298
+ Ee === "tags" && (Ee = "multiple", _ = !0, Rt(
299
+ !0,
300
+ `[Pqb Select] The 'tags' mode will be removed in the next major version, please use {mode: "multiple", allowCreate: true} instead.`
301
+ ));
302
+ const S = x("select"), g = Ee === "multiple";
303
+ g || (He = !1);
304
+ const [ft, Le] = _e(
305
+ ot(u.defaultValue, g, k)
306
+ ), i = "value" in u ? ot(u.value, g, k) : ft, [V, mt, gt] = tt("", {
307
+ value: "inputValue" in u ? u.inputValue || "" : void 0
308
+ }), [N, ht] = tt(!1, {
309
+ defaultValue: u.defaultPopupVisible,
310
+ value: "popupVisible" in u ? u.popupVisible : s && "popupVisible" in s ? s.popupVisible : void 0
311
+ }), [ue, Ct] = _e(null), [pe, Ot] = _e([]), [F, re] = _e(
312
+ ee(i) ? i[0] : i
313
+ ), {
314
+ childrenList: $e,
315
+ optionInfoMap: m,
316
+ optionValueList: W,
317
+ optionIndexListForArrowKey: X,
318
+ hasOptGroup: yt,
319
+ hasComplexLabelInOptions: _t
320
+ } = et(() => ct(
321
+ { children: L, options: $, filterOption: H },
322
+ {
323
+ prefixCls: S,
324
+ inputValue: V,
325
+ userCreatedOptions: pe,
326
+ userCreatingOption: ue
327
+ }
328
+ ), [
329
+ L,
330
+ $,
331
+ H,
332
+ V,
333
+ ue,
334
+ pe
335
+ ]), Ie = j(null), je = j(null), A = j(null), Y = j([]), q = j(null), Ke = j(V), Ne = j(null), me = j(0), Te = j(!1), Be = Lt(`${S}-popup-`), ge = be(i, g), Qe = et(() => {
336
+ var e, t;
337
+ if (D) {
338
+ const n = ee(i) ? i[0] : i, r = !ge && ((e = m.get(n)) == null ? void 0 : e._valid), c = ((t = m == null ? void 0 : m.get(W[0])) == null ? void 0 : t._origin) === it;
339
+ return r && !c ? n : W[X[0]];
340
+ }
341
+ }, [
342
+ i,
343
+ m,
344
+ W,
345
+ X,
346
+ D,
347
+ ge
348
+ ]), he = Ue(
349
+ (e, t) => {
350
+ var r;
351
+ const n = m.get(e);
352
+ Ie.current && ((r = n == null ? void 0 : n.child) != null && r.props) && Ie.current.scrollTo({
353
+ key: n.child.props._key,
354
+ options: t
355
+ });
356
+ },
357
+ [m]
358
+ ), Ce = Ue(
359
+ (e, t = !1) => U(_) && typeof (_ == null ? void 0 : _.formatter) == "function" ? _.formatter(e, t) : e,
360
+ [_]
361
+ ), Z = (e, t) => {
362
+ (e !== Ke.current || t !== Ne.current) && (mt(e), Ke.current = e, Ne.current = t, Se == null || Se(e, t));
363
+ }, oe = (e) => {
364
+ var t;
365
+ N !== e && (ht(e), ke == null || ke(e), (t = s == null ? void 0 : s.onVisibleChange) == null || t.call(s, e));
366
+ };
367
+ K(() => {
368
+ g ? Array.isArray(i) || Le(i === void 0 ? [] : [i]) : Array.isArray(i) && Le(i.length === 0 ? void 0 : i[0]);
369
+ }, [g, i]), K(() => {
370
+ if (N) {
371
+ re(Qe);
372
+ const e = ee(i) ? i[0] : i;
373
+ !ge && m.has(e) && setTimeout(() => he(e));
374
+ }
375
+ }, [N]), K(() => {
376
+ (q.current === "up" || q.current === "down") && (he(F), q.current = "none");
377
+ }, [F]), K(() => {
378
+ re(Qe);
379
+ }, [JSON.stringify($e.map((e) => {
380
+ var t;
381
+ return (t = e == null ? void 0 : e.props) == null ? void 0 : t.value;
382
+ }))]), K(() => {
383
+ Y.current = Y.current.filter((e) => g ? ee(i) && i.indexOf(e.value) > -1 : e.value === i);
384
+ }, [i, g]), K(() => {
385
+ if (_) {
386
+ let e;
387
+ if (be(i, g))
388
+ e = [];
389
+ else {
390
+ const n = Array.isArray(i) ? i : [i], r = n.filter((p) => {
391
+ var T;
392
+ const C = m.get(p) || ((T = Y.current.find((d) => d.value === p)) == null ? void 0 : T.option);
393
+ return !C || C._origin === it;
394
+ }).map((p) => Ce(p));
395
+ e = pe.filter((p) => {
396
+ const C = U(p) ? p.value : p;
397
+ return n.indexOf(C) !== -1;
398
+ }).concat(
399
+ r
400
+ );
401
+ }
402
+ const t = (n) => n.map((r) => U(r) ? r.value : r).toString();
403
+ t(e) !== t(pe) && Ot(e);
404
+ }
405
+ }, [i, _, g, Ce]), K(() => {
406
+ _ && Ct(
407
+ V && !m.has(V) ? Ce(V, !0) : null
408
+ );
409
+ }, [V, Ce]), K(() => {
410
+ const { current: e } = Ne;
411
+ gt === V && (e === "manual" || e === "optionListHide") && (ve == null || ve(V, e));
412
+ }, [V]);
413
+ const ce = Ue(
414
+ (e) => {
415
+ const t = m.get(e);
416
+ if (t) {
417
+ const r = Y.current.findIndex(
418
+ (c) => c.value === e
419
+ );
420
+ return r > -1 ? Y.current.splice(r, 1, { value: e, option: t }) : Y.current.push({ value: e, option: t }), t;
421
+ }
422
+ const n = Y.current.find((r) => r.value === e);
423
+ return n && n.option;
424
+ },
425
+ [m]
426
+ ), We = (e) => {
427
+ if (!X.length)
428
+ return;
429
+ if (F === void 0 || !m.has(F))
430
+ return W[X[0]];
431
+ const n = m.get(F)._index, r = X.indexOf(n), c = X.length;
432
+ return W[X[((e === "up" ? r - 1 : r + 1) + c) % c]];
433
+ }, Oe = (e, t = be(e, g)) => {
434
+ let n = e;
435
+ const r = e === void 0 ? void 0 : Array.isArray(e) ? e.map(ce) : ce(e);
436
+ if (k && !t) {
437
+ const c = (p, C) => {
438
+ if (C)
439
+ return C.children;
440
+ const T = "value" in u ? u.value : "defaultValue" in u ? u.defaultValue : null;
441
+ if (Array.isArray(T)) {
442
+ for (const d of T)
443
+ if (U(d) && d.value === p)
444
+ return d.label;
445
+ } else if (U(T) && T.value === p)
446
+ return T.label;
447
+ };
448
+ Array.isArray(e) ? n = e.map((p, C) => ({
449
+ value: p,
450
+ label: c(p, r[C])
451
+ })) : n = {
452
+ value: e,
453
+ label: c(e, r)
454
+ };
455
+ }
456
+ return { option: r, value: n };
457
+ }, z = (e) => {
458
+ if (Le(e), se) {
459
+ const t = Oe(e);
460
+ se(t.value, t.option);
461
+ }
462
+ }, qe = (e, t) => {
463
+ if (t === "remove" || t === "add" && m.get(e)) {
464
+ const n = t === "add" ? i.concat(e) : i.filter((c) => c !== e), r = t === "add" ? le : ae;
465
+ if (z(n), typeof r == "function") {
466
+ const c = Oe(
467
+ e,
468
+ !1
469
+ );
470
+ r(
471
+ c.value,
472
+ c.option
473
+ );
474
+ }
475
+ }
476
+ }, Je = (e, t) => {
477
+ t || (g ? (qe(
478
+ e,
479
+ i.indexOf(e) === -1 ? "add" : "remove"
480
+ ), (!U(G) || !G.retainInputValueWhileSelect) && Z("", "optionChecked")) : (e !== i && z(e), setTimeout(() => {
481
+ oe(!1);
482
+ })));
483
+ }, ye = Tt(
484
+ /* @__PURE__ */ new Map([
485
+ [Pt.key, () => oe(!1)],
486
+ [
487
+ nt.key,
488
+ () => {
489
+ if (N) {
490
+ const e = m.get(F);
491
+ e && Je(F, e.disabled);
492
+ } else
493
+ oe(!0);
494
+ }
495
+ ],
496
+ [
497
+ rt.key,
498
+ // 按tab键切换,关闭开启的弹出框
499
+ () => oe(!1)
500
+ ],
501
+ [
502
+ Ft.key,
503
+ () => {
504
+ if (N)
505
+ return q.current = "up", re(We("up")), !1;
506
+ }
507
+ ],
508
+ [
509
+ Ut.key,
510
+ () => {
511
+ if (N)
512
+ return q.current = "down", re(We("down")), !1;
513
+ }
514
+ ]
515
+ ])
516
+ ), bt = () => {
517
+ var C, T;
518
+ const e = (s == null ? void 0 : s.autoAlignPopupWidth) === !1 && (!((C = s == null ? void 0 : s.style) != null && C.width) || ((T = s == null ? void 0 : s.style) == null ? void 0 : T.width) === "auto"), t = e && _t, n = "notFoundContent" in u ? w : O("Select"), r = $e.length ? /* @__PURE__ */ E(
519
+ Mt,
520
+ {
521
+ id: Be,
522
+ role: "listbox",
523
+ style: h,
524
+ className: fe(`${S}-popup-inner`, I),
525
+ ref: Ie,
526
+ data: $e,
527
+ height: null,
528
+ isStaticItemHeight: !yt,
529
+ measureLongestItem: e,
530
+ itemKey: (d) => d.props._key,
531
+ onMouseDown: Xt,
532
+ onMouseMove: () => {
533
+ q.current = null;
534
+ },
535
+ onScroll: (d) => xe == null ? void 0 : xe(d.target),
536
+ ...y,
537
+ threshold: t ? null : y == null ? void 0 : y.threshold,
538
+ children: (d) => {
539
+ var Ze;
540
+ if (pt(d))
541
+ return /* @__PURE__ */ E(d.type, { ...d.props, prefixCls: S });
542
+ if (ut(d)) {
543
+ const ze = (Ze = d.props) == null ? void 0 : Ze.value, wt = U(ue) ? ue.value : ue, xt = pe.map(
544
+ (de) => U(de) ? de.value : de
545
+ ), kt = {
546
+ prefixCls: S,
547
+ rtl: P,
548
+ _valueActive: F,
549
+ _valueSelect: i,
550
+ _isMultipleMode: g,
551
+ _isUserCreatingOption: _ && wt === ze,
552
+ _isUserCreatedOption: _ && xt.indexOf(ze) > -1,
553
+ _onClick: Je,
554
+ _onMouseEnter: (de) => {
555
+ q.current === null && re(de);
556
+ },
557
+ _onMouseLeave: () => {
558
+ q.current === null && re(void 0);
559
+ }
560
+ };
561
+ return d && /* @__PURE__ */ E(d.type, { ...d.props, ...kt });
562
+ }
563
+ return d;
564
+ }
565
+ }
566
+ ) : null, p = n && !(_ && V) ? /* @__PURE__ */ E(
567
+ "div",
568
+ {
569
+ style: h,
570
+ className: fe(`${S}-popup-inner`, I),
571
+ children: n
572
+ }
573
+ ) : null;
574
+ return /* @__PURE__ */ st(
575
+ "div",
576
+ {
577
+ className: fe(`${S}-popup`, {
578
+ [`${S}-popup-hidden`]: r === null && p === null,
579
+ [`${S}-popup-multiple`]: g
580
+ }),
581
+ tabIndex: -1,
582
+ onKeyDown: (d) => ye(d),
583
+ children: [
584
+ !!g && !!r && !!He && // 潘启宝添加
585
+ /* @__PURE__ */ E(
586
+ lt,
587
+ {
588
+ "aria-hidden": "true",
589
+ className: `${S}-checkbox ${S}-checkbox-all`,
590
+ checked: W.length === i.length,
591
+ indeterminate: W.length !== i.length && i.length !== 0,
592
+ onChange: (d) => {
593
+ z(d ? [...W] : []);
594
+ },
595
+ children: "全选"
596
+ }
597
+ ),
598
+ typeof b == "function" ? b(r || p) : r || p
599
+ ]
600
+ }
601
+ );
602
+ }, Pe = (e) => {
603
+ if (me.current = null, g && ee(Q) && Q.length) {
604
+ const t = e.split(new RegExp(`[${Q.join("")}]`));
605
+ if (t.length > 1) {
606
+ me.current = Date.now();
607
+ const n = t.filter(
608
+ (p, C) => p && t.indexOf(p) === C
609
+ ), r = i.slice(0);
610
+ let c = !1;
611
+ n.forEach((p) => {
612
+ r.indexOf(p) === -1 && (_ || m.get(p)) && (r.push(p), c = !0);
613
+ }), c && z(r);
614
+ }
615
+ }
616
+ return !!me.current;
617
+ }, vt = {
618
+ onFocus: dt,
619
+ onBlur: (e) => {
620
+ we == null || we(e), !N && !Te.current && Z("", "optionListHide");
621
+ },
622
+ onKeyDown: (e) => {
623
+ if (e.target.tagName === "INPUT" && e.target.value) {
624
+ const t = e.key === rt.key, n = e.key === nt.key;
625
+ if (n || t) {
626
+ const r = n ? `
627
+ ` : t ? " " : "";
628
+ Pe(e.target.value + r) && Z("", "tokenSeparator");
629
+ }
630
+ }
631
+ ye(e), Ae == null || Ae(e);
632
+ },
633
+ onChangeInputValue: (e, { nativeEvent: { inputType: t } }) => {
634
+ t !== "insertFromPaste" && Pe(e), me.current ? Z("", "tokenSeparator") : Z(e, "manual"), !N && e && oe(!0);
635
+ },
636
+ onPaste: (e) => {
637
+ Pe(e.clipboardData.getData("text")), Ve == null || Ve(e);
638
+ },
639
+ // Option Items
640
+ onRemoveCheckedItem: (e, t, n) => {
641
+ n.stopPropagation(), qe(i[t], "remove");
642
+ },
643
+ onClear: (e) => {
644
+ if (e.stopPropagation(), g) {
645
+ const t = i.filter((n) => {
646
+ const r = m.get(n);
647
+ return r && r.disabled;
648
+ });
649
+ z(t);
650
+ } else
651
+ z(void 0);
652
+ Z("", "manual"), ne == null || ne(N);
653
+ }
654
+ };
655
+ At(
656
+ v,
657
+ () => {
658
+ var e;
659
+ return {
660
+ dom: (e = A.current) == null ? void 0 : e.dom,
661
+ focus() {
662
+ A.current && A.current.focus();
663
+ },
664
+ blur() {
665
+ A.current && A.current.blur();
666
+ },
667
+ hotkeyHandler: ye,
668
+ activeOptionValue: F,
669
+ getOptionInfoByValue: ce,
670
+ getOptionInfoList: () => [...m.values()].filter((t) => t._valid),
671
+ scrollIntoView: he,
672
+ getRootDOMNode() {
673
+ var t, n;
674
+ return (n = (t = A.current) == null ? void 0 : t.getRootDOMNode) == null ? void 0 : n.call(t);
675
+ }
676
+ };
677
+ },
678
+ [
679
+ ye,
680
+ m,
681
+ F,
682
+ ce,
683
+ he
684
+ ]
685
+ );
686
+ const Xe = (e) => /* @__PURE__ */ E(
687
+ Nt,
688
+ {
689
+ ref: (t) => je.current = t,
690
+ popup: bt,
691
+ trigger: f,
692
+ disabled: J,
693
+ getPopupContainer: o,
694
+ classNames: "slideDynamicOrigin",
695
+ autoAlignPopupWidth: !0,
696
+ popupAlign: Zt,
697
+ popupVisible: N,
698
+ unmountOnExit: B,
699
+ onVisibleChange: oe,
700
+ __onExit: () => {
701
+ Te.current = !0;
702
+ },
703
+ __onExited: () => {
704
+ Te.current = !1, Z("", "optionListHide");
705
+ },
706
+ ...Me(s, ["popupVisible", "onVisibleChange"]),
707
+ children: e
708
+ }
709
+ ), Fe = typeof a == "function" ? a(Oe(i)) : a;
710
+ return K(() => {
711
+ var t;
712
+ let e;
713
+ return (t = A.current) != null && t.dom && (e = new ResizeObserver(() => {
714
+ var n, r;
715
+ (r = (n = je.current) == null ? void 0 : n.updatePopupPosition) == null || r.call(n);
716
+ }), e.observe(A.current.dom)), () => {
717
+ var n, r, c;
718
+ (n = A.current) != null && n.dom && ((r = e == null ? void 0 : e.unobserve) == null || r.call(e, A.current.dom)), (c = e == null ? void 0 : e.disconnect) == null || c.call(e), e = null;
719
+ };
720
+ }, [(Ye = A.current) == null ? void 0 : Ye.dom]), Fe != null ? Xe(Fe) : /* @__PURE__ */ E(
721
+ It,
722
+ {
723
+ ...u,
724
+ ...vt,
725
+ ref: A,
726
+ value: i,
727
+ inputValue: V,
728
+ popupVisible: N,
729
+ rtl: P,
730
+ prefixCls: S,
731
+ allowCreate: !!_,
732
+ ariaControls: Be,
733
+ isEmptyValue: ge,
734
+ isMultiple: g,
735
+ onSort: z,
736
+ renderText: (e) => {
737
+ const t = ce(e);
738
+ let n = e;
739
+ if (St(M)) {
740
+ const r = Oe(e, !1);
741
+ n = M(
742
+ r.option || null,
743
+ r.value
744
+ );
745
+ } else {
746
+ let r = !1;
747
+ if (k) {
748
+ const c = u.value || u.defaultValue;
749
+ if (Array.isArray(c)) {
750
+ const p = c.find(
751
+ (C) => U(C) && C.value === e
752
+ );
753
+ p && (n = p.label, r = !0);
754
+ } else U(c) && (n = c.label, r = !0);
755
+ }
756
+ !r && t && "children" in t && (n = t.children);
757
+ }
758
+ return {
759
+ text: n,
760
+ disabled: t && t.disabled
761
+ };
762
+ },
763
+ renderView: Xe
764
+ }
765
+ );
766
+ }
767
+ const en = te.forwardRef(zt), Ge = en;
768
+ Ge.displayName = "Select";
769
+ Ge.Option = De;
770
+ Ge.OptGroup = at;
771
+ export {
772
+ De as O,
773
+ Ge as S,
774
+ pt as a,
775
+ at as b,
776
+ ut as i
777
+ };