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