@unicom-cloud/ui 0.8.52 → 0.8.53
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 +41 -40
- package/Alert.js +2 -2
- package/Anchor.js +1 -1
- package/AutoComplete.js +3 -3
- package/Avatar.js +1 -1
- package/BackTop.js +2 -2
- package/Badge.js +2 -2
- package/Breadcrumb.js +2 -2
- package/Button.js +1 -1
- package/Calendar.js +3 -3
- package/Card.js +1 -1
- package/Carousel.js +1 -1
- package/Cascader.js +1 -1
- package/Checkbox.js +1 -1
- package/Collapse.js +1 -1
- package/ColorPicker.js +3 -3
- package/Comment.js +1 -1
- package/ConfigProvider.js +2 -2
- package/Copy.js +1 -1
- package/DatePicker.js +1268 -1233
- package/Descriptions.js +1 -1
- package/Divider.js +1 -1
- package/Draggable.js +1 -1
- package/Drawer.js +1 -1
- package/Dropdown.js +1 -1
- package/Empty.js +1 -1
- package/Form.js +122 -117
- package/Grid.js +86 -83
- package/Icon.js +1 -1
- package/IconHover.js +1 -1
- package/Image.js +1 -1
- package/Input.js +1 -1
- package/InputNumber.js +2 -2
- package/InputTag.js +1 -1
- package/Layout.js +2 -2
- package/Link.js +1 -1
- package/List.js +3 -3
- package/Mentions.js +3 -3
- package/Menu.js +1 -1
- package/Message.js +2 -2
- package/Modal.js +1 -1
- package/Notice.js +1 -1
- package/Notification.js +2 -2
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/Pagination.js +1 -1
- package/Picker.js +1 -1
- package/Popconfirm.js +1 -1
- package/Popover.js +1 -1
- package/Progress.js +1 -1
- package/Radio.js +2 -2
- package/Rate.js +1 -1
- package/ResizeBox.js +33 -32
- package/Result.js +1 -1
- package/Select.js +1 -1
- package/SelectView.js +142 -141
- package/Skeleton.js +1 -1
- package/Slider.js +2 -2
- package/Space.js +1 -1
- package/Spin.js +1 -1
- package/Statistic.js +1 -1
- package/Steps.js +1 -1
- package/Switch.js +15 -14
- package/Table.js +141 -133
- package/Tabs.js +1 -1
- package/Tag.js +111 -82
- package/TimePicker.js +3 -3
- package/Timeline.js +1 -1
- package/Tooltip.js +1 -1
- package/Transfer.js +3 -3
- package/Tree.js +1 -1
- package/TreeSelect.js +1 -1
- package/Trigger.js +31 -30
- package/Typography.js +25 -25
- package/Upload.js +1 -1
- package/VerificationCode.js +1 -1
- package/Version.js +1 -1
- package/Watermark.js +1 -1
- package/chunk/{CoevJNNj.js → -sV-N67P.js} +1 -1
- package/chunk/{CkIWpIl6.js → 8hWViek4.js} +1 -1
- package/chunk/{Ct7mcZuW.js → B8IzaBdN.js} +1 -1
- package/chunk/{DCe3olyi.js → BEVtQ2QL.js} +101 -99
- package/chunk/{tkU8zIK4.js → BEiJmFHq.js} +1 -1
- package/chunk/{CQvJK4kb.js → BOUZ7hSf.js} +12 -12
- package/chunk/{DMeJAY1S.js → BYMRs7t5.js} +6 -5
- package/chunk/{DWGwYNvC.js → CBaVCRtG.js} +2 -2
- package/chunk/{5PpvDpEt.js → CLU6Le34.js} +2 -2
- package/chunk/{dhljdm11.js → COWsswcW.js} +64 -63
- package/chunk/{B9nYZhXo.js → CRxPui7e.js} +2 -2
- package/chunk/CYyPBcnp.js +970 -0
- package/chunk/{DfvdYCUz.js → CccPQyYX.js} +1 -1
- package/chunk/{DUX5Hw8l.js → CmEyvBdT.js} +3 -3
- package/chunk/{Cku5-xbe.js → Cwp65v9h.js} +47 -46
- package/chunk/{I0bfWb5y.js → CyVLxv_U.js} +95 -93
- package/chunk/{Cw63stMm.js → Cz65nXZD.js} +18 -18
- package/chunk/D3pUE3-b.js +445 -0
- package/chunk/{9AJ-uN8F.js → D6BMh1k4.js} +1 -1
- package/chunk/{BHWpeAbb.js → DGK45cuc.js} +1 -1
- package/chunk/{CfqAfcA3.js → DNyP-r9G.js} +2 -2
- package/chunk/DQ3uFRJD.js +892 -0
- package/chunk/{4XXtB4ZV.js → DY9WA4bf.js} +1 -1
- package/chunk/{DG5zSZDd.js → DdVbiC4t.js} +2 -2
- package/chunk/{n58kSv9T.js → DfMf16uZ.js} +11 -5
- package/chunk/{z7sBNzI4.js → Lyg-9NEt.js} +17 -17
- package/chunk/{BXZYc88i.js → PRN8SqRA.js} +3 -3
- package/chunk/bcn23eHi.js +277 -0
- package/index.js +408 -346
- package/package.json +1 -23
- package/style.css +1 -1
- package/types/color-picker/colors.d.ts +1 -1
- package/types/date-picker/Picker.d.ts +4 -3
- package/types/date-picker/PickerRange.d.ts +3 -7
- package/types/date-picker/interface.d.ts +9 -1
- package/types/grid/index.d.ts +2 -1
- package/types/index.d.ts +1 -0
- package/types/pagination/interface.d.ts +1 -0
- package/types/picker/InputRange.d.ts +1 -1
- package/types/select/Select.d.ts +1 -1
- package/types/tag/interface.d.ts +7 -3
- package/types/utils/CSSTransition.d.ts +2 -1
- package/types/utils/is.d.ts +4 -17
- package/types/version/index.d.ts +1 -1
- package/utils/CSSTransition.js +1 -1
- package/utils/contextHolder.js +1 -1
- package/utils/is.js +102 -104
- package/utils/reactDOM.js +19 -19
- package/chunk/C61BEbHK.js +0 -263
- package/chunk/DXMtLuTP.js +0 -443
- package/chunk/m3_n9fBe.js +0 -961
- package/chunk/uUGMUxt_.js +0 -474
|
@@ -2,21 +2,21 @@ import { jsx as x, jsxs as it, Fragment as kt } from "react/jsx-runtime";
|
|
|
2
2
|
import ee from "lodash/isArray";
|
|
3
3
|
import St from "lodash/isFunction";
|
|
4
4
|
import te, { useContext as Vt, useState as ye, useMemo as ze, useRef as j, useCallback as Ue, useEffect as K, useImperativeHandle as At } from "react";
|
|
5
|
-
import { C as st } from "./
|
|
6
|
-
import { a as Et } from "./
|
|
5
|
+
import { C as st } from "./B8IzaBdN.js";
|
|
6
|
+
import { a as Et } from "./Lyg-9NEt.js";
|
|
7
7
|
import Lt from "../hooks/useId.js";
|
|
8
|
-
import
|
|
8
|
+
import $t from "../hooks/useMergeProps.js";
|
|
9
9
|
import et from "../hooks/useMergeValue.js";
|
|
10
|
-
import
|
|
10
|
+
import Nt from "../SelectView.js";
|
|
11
11
|
import It from "../Trigger.js";
|
|
12
12
|
import ce from "@unicom-cloud/utils/class-name";
|
|
13
13
|
import Pt from "../utils/getHotkeyHandler.js";
|
|
14
|
-
import
|
|
14
|
+
import "../utils/is.js";
|
|
15
15
|
import { Esc as Tt, Enter as tt, Tab as nt, ArrowUp as Ft, ArrowDown as Ut } from "../utils/keyCode.js";
|
|
16
16
|
import Me from "../utils/omit.js";
|
|
17
17
|
import Rt from "../utils/warning.js";
|
|
18
18
|
import { V as Mt } from "./CiEln_Q1.js";
|
|
19
|
-
import { isEmptyArray as Dt } from "@unicom-cloud/utils/is";
|
|
19
|
+
import { isEmptyArray as Dt, isPlainObject as U } from "@unicom-cloud/utils/is";
|
|
20
20
|
import ie from "lodash/get";
|
|
21
21
|
import Gt from "lodash/isNil";
|
|
22
22
|
import Ht from "lodash/isNumber";
|
|
@@ -53,7 +53,7 @@ function qt(l, b) {
|
|
|
53
53
|
_isUserCreatingOption: v,
|
|
54
54
|
_valueActive: G,
|
|
55
55
|
_valueSelect: Q,
|
|
56
|
-
_onMouseEnter:
|
|
56
|
+
_onMouseEnter: $,
|
|
57
57
|
_onMouseLeave: H,
|
|
58
58
|
_onClick: k,
|
|
59
59
|
...o
|
|
@@ -70,17 +70,17 @@ function qt(l, b) {
|
|
|
70
70
|
},
|
|
71
71
|
C
|
|
72
72
|
),
|
|
73
|
-
onMouseEnter: (
|
|
73
|
+
onMouseEnter: (N) => {
|
|
74
74
|
var y;
|
|
75
|
-
|
|
75
|
+
$ == null || $(f), (y = o.onMouseEnter) == null || y.call(o, N);
|
|
76
76
|
},
|
|
77
|
-
onMouseLeave: (
|
|
77
|
+
onMouseLeave: (N) => {
|
|
78
78
|
var y;
|
|
79
|
-
H == null || H(), (y = o.onMouseLeave) == null || y.call(o,
|
|
79
|
+
H == null || H(), (y = o.onMouseLeave) == null || y.call(o, N);
|
|
80
80
|
},
|
|
81
|
-
onClick: (
|
|
81
|
+
onClick: (N) => {
|
|
82
82
|
var y;
|
|
83
|
-
k == null || k(f, T), (y = o.onClick) == null || y.call(o,
|
|
83
|
+
k == null || k(f, T), (y = o.onClick) == null || y.call(o, N);
|
|
84
84
|
},
|
|
85
85
|
...Me(o, [
|
|
86
86
|
"_key",
|
|
@@ -160,20 +160,20 @@ function pt({
|
|
|
160
160
|
const Q = (o) => {
|
|
161
161
|
const f = ie(o, "props.value"), s = ie(o, "props.children");
|
|
162
162
|
return f === void 0 && s !== null && s !== void 0 ? s.toString() : f;
|
|
163
|
-
},
|
|
163
|
+
}, $ = ({ label: o, value: f }, s, a) => !o && !f && !s ? (D++, `custom_node_${D}`) : a ? s || `group_${o}` : s || `${typeof f}_${f}` || `${o}_${L.size}`, H = (o, f) => {
|
|
164
164
|
const s = Q(o);
|
|
165
165
|
let a = !0;
|
|
166
166
|
w === !0 ? a = s !== void 0 && String(s).toLowerCase().indexOf(C.toLowerCase()) !== -1 : typeof w == "function" && (a = !C || w(C, o));
|
|
167
167
|
const O = L.get(s), S = (O == null ? void 0 : O._origin) === "userCreatedOptions" || (O == null ? void 0 : O._origin) === "userCreatingOption";
|
|
168
168
|
if (!O || S) {
|
|
169
169
|
"_key" in o.props || (o = te.cloneElement(o, {
|
|
170
|
-
_key:
|
|
170
|
+
_key: $(o.props, o.key)
|
|
171
171
|
}));
|
|
172
|
-
const
|
|
172
|
+
const N = L.size, y = {
|
|
173
173
|
child: o,
|
|
174
174
|
...o.props,
|
|
175
175
|
value: s,
|
|
176
|
-
_index:
|
|
176
|
+
_index: N,
|
|
177
177
|
_origin: f,
|
|
178
178
|
_valid: a
|
|
179
179
|
};
|
|
@@ -186,7 +186,7 @@ function pt({
|
|
|
186
186
|
);
|
|
187
187
|
ne > -1 && (a ? v[ne] = o : v.splice(ne, 1));
|
|
188
188
|
} else
|
|
189
|
-
M.push(s), a && (v.push(o), y.disabled || G.push(
|
|
189
|
+
M.push(s), a && (v.push(o), y.disabled || G.push(N));
|
|
190
190
|
}
|
|
191
191
|
typeof o.props.children != "string" && (B = !0);
|
|
192
192
|
}, k = (o, f) => {
|
|
@@ -198,7 +198,7 @@ function pt({
|
|
|
198
198
|
const a = /* @__PURE__ */ x(
|
|
199
199
|
De,
|
|
200
200
|
{
|
|
201
|
-
_key:
|
|
201
|
+
_key: $(s),
|
|
202
202
|
value: s.value,
|
|
203
203
|
disabled: s.disabled === !0,
|
|
204
204
|
extra: s.extra,
|
|
@@ -222,14 +222,14 @@ function pt({
|
|
|
222
222
|
a.length && (v.push(
|
|
223
223
|
te.cloneElement(o, {
|
|
224
224
|
children: null,
|
|
225
|
-
_key:
|
|
225
|
+
_key: $(o.props, o.key, !0)
|
|
226
226
|
})
|
|
227
227
|
), v = v.concat(a), G = G.concat(
|
|
228
228
|
O
|
|
229
229
|
), J = !0, B = B || S);
|
|
230
230
|
} else at(o) ? H(o, "children") : Re(o) && o.props && v.push(
|
|
231
231
|
te.cloneElement(o, {
|
|
232
|
-
_key:
|
|
232
|
+
_key: $(o.props, o.key)
|
|
233
233
|
})
|
|
234
234
|
);
|
|
235
235
|
}), k(b, "options"), k(R, "userCreatedOptions"), {
|
|
@@ -254,7 +254,7 @@ const ot = "userCreatingOption", Yt = {
|
|
|
254
254
|
}, Zt = { bottom: 4 };
|
|
255
255
|
function zt(l, b) {
|
|
256
256
|
var Xe;
|
|
257
|
-
const { getPrefixCls: w, renderEmpty: C, componentConfig: R, rtl: T } = Vt(Et), u =
|
|
257
|
+
const { getPrefixCls: w, renderEmpty: C, componentConfig: R, rtl: T } = Vt(Et), u = $t(
|
|
258
258
|
l,
|
|
259
259
|
Yt,
|
|
260
260
|
R == null ? void 0 : R.Select
|
|
@@ -267,7 +267,7 @@ function zt(l, b) {
|
|
|
267
267
|
notFoundContent: v,
|
|
268
268
|
showSearch: G,
|
|
269
269
|
tokenSeparators: Q,
|
|
270
|
-
options:
|
|
270
|
+
options: $,
|
|
271
271
|
filterOption: H,
|
|
272
272
|
labelInValue: k,
|
|
273
273
|
getPopupContainer: o,
|
|
@@ -276,7 +276,7 @@ function zt(l, b) {
|
|
|
276
276
|
triggerProps: a,
|
|
277
277
|
dropdownRender: O,
|
|
278
278
|
dropdownMenuStyle: S,
|
|
279
|
-
dropdownMenuClassName:
|
|
279
|
+
dropdownMenuClassName: N,
|
|
280
280
|
virtualListProps: y,
|
|
281
281
|
// events
|
|
282
282
|
onChange: ne,
|
|
@@ -307,14 +307,14 @@ function zt(l, b) {
|
|
|
307
307
|
}), [le, ht] = ye(null), [ae, Ct] = ye([]), [F, re] = ye(
|
|
308
308
|
ee(i) ? i[0] : i
|
|
309
309
|
), {
|
|
310
|
-
childrenList:
|
|
310
|
+
childrenList: $e,
|
|
311
311
|
optionInfoMap: m,
|
|
312
312
|
optionValueList: W,
|
|
313
313
|
optionIndexListForArrowKey: X,
|
|
314
314
|
hasOptGroup: Ot,
|
|
315
315
|
hasComplexLabelInOptions: yt
|
|
316
316
|
} = ze(() => pt(
|
|
317
|
-
{ children: L, options:
|
|
317
|
+
{ children: L, options: $, filterOption: H },
|
|
318
318
|
{
|
|
319
319
|
prefixCls: V,
|
|
320
320
|
inputValue: A,
|
|
@@ -323,16 +323,16 @@ function zt(l, b) {
|
|
|
323
323
|
}
|
|
324
324
|
), [
|
|
325
325
|
L,
|
|
326
|
-
|
|
326
|
+
$,
|
|
327
327
|
H,
|
|
328
328
|
A,
|
|
329
329
|
le,
|
|
330
330
|
ae
|
|
331
|
-
]),
|
|
331
|
+
]), Ne = j(null), He = j(null), E = j(null), Y = j([]), q = j(null), je = j(A), Ie = j(null), fe = j(0), Pe = j(!1), Ke = Lt(`${V}-popup-`), me = _e(i, g), Be = ze(() => {
|
|
332
332
|
var e, t;
|
|
333
333
|
if (D) {
|
|
334
|
-
const
|
|
335
|
-
return
|
|
334
|
+
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;
|
|
335
|
+
return r && !c ? n : W[X[0]];
|
|
336
336
|
}
|
|
337
337
|
}, [
|
|
338
338
|
i,
|
|
@@ -343,10 +343,10 @@ function zt(l, b) {
|
|
|
343
343
|
me
|
|
344
344
|
]), ge = Ue(
|
|
345
345
|
(e, t) => {
|
|
346
|
-
var
|
|
347
|
-
const
|
|
348
|
-
|
|
349
|
-
key:
|
|
346
|
+
var r;
|
|
347
|
+
const n = m.get(e);
|
|
348
|
+
Ne.current && ((r = n == null ? void 0 : n.child) != null && r.props) && Ne.current.scrollTo({
|
|
349
|
+
key: n.child.props._key,
|
|
350
350
|
options: t
|
|
351
351
|
});
|
|
352
352
|
},
|
|
@@ -358,7 +358,7 @@ function zt(l, b) {
|
|
|
358
358
|
(e !== je.current || t !== Ie.current) && (ft(e), je.current = e, Ie.current = t, Se == null || Se(e, t));
|
|
359
359
|
}, oe = (e) => {
|
|
360
360
|
var t;
|
|
361
|
-
I !== e && (gt(e), ke == null || ke(e),
|
|
361
|
+
I !== e && (gt(e), ke == null || ke(e), (t = a == null ? void 0 : a.onVisibleChange) == null || t.call(a, e));
|
|
362
362
|
};
|
|
363
363
|
K(() => {
|
|
364
364
|
g ? Array.isArray(i) || Le(i === void 0 ? [] : [i]) : Array.isArray(i) && Le(i.length === 0 ? void 0 : i[0]);
|
|
@@ -372,7 +372,7 @@ function zt(l, b) {
|
|
|
372
372
|
(q.current === "up" || q.current === "down") && (ge(F), q.current = "none");
|
|
373
373
|
}, [F]), K(() => {
|
|
374
374
|
re(Be);
|
|
375
|
-
}, [JSON.stringify(
|
|
375
|
+
}, [JSON.stringify($e.map((e) => {
|
|
376
376
|
var t;
|
|
377
377
|
return (t = e == null ? void 0 : e.props) == null ? void 0 : t.value;
|
|
378
378
|
}))]), K(() => {
|
|
@@ -383,19 +383,19 @@ function zt(l, b) {
|
|
|
383
383
|
if (_e(i, g))
|
|
384
384
|
e = [];
|
|
385
385
|
else {
|
|
386
|
-
const
|
|
386
|
+
const n = Array.isArray(i) ? i : [i], r = n.filter((p) => {
|
|
387
387
|
var P;
|
|
388
388
|
const h = m.get(p) || ((P = Y.current.find((d) => d.value === p)) == null ? void 0 : P.option);
|
|
389
389
|
return !h || h._origin === ot;
|
|
390
390
|
}).map((p) => he(p));
|
|
391
391
|
e = ae.filter((p) => {
|
|
392
392
|
const h = U(p) ? p.value : p;
|
|
393
|
-
return
|
|
393
|
+
return n.indexOf(h) !== -1;
|
|
394
394
|
}).concat(
|
|
395
|
-
|
|
395
|
+
r
|
|
396
396
|
);
|
|
397
397
|
}
|
|
398
|
-
const t = (
|
|
398
|
+
const t = (n) => n.map((r) => U(r) ? r.value : r).toString();
|
|
399
399
|
t(e) !== t(ae) && Ct(e);
|
|
400
400
|
}
|
|
401
401
|
}, [i, _, g, he]), K(() => {
|
|
@@ -410,13 +410,13 @@ function zt(l, b) {
|
|
|
410
410
|
(e) => {
|
|
411
411
|
const t = m.get(e);
|
|
412
412
|
if (t) {
|
|
413
|
-
const
|
|
413
|
+
const r = Y.current.findIndex(
|
|
414
414
|
(c) => c.value === e
|
|
415
415
|
);
|
|
416
|
-
return
|
|
416
|
+
return r > -1 ? Y.current.splice(r, 1, { value: e, option: t }) : Y.current.push({ value: e, option: t }), t;
|
|
417
417
|
}
|
|
418
|
-
const
|
|
419
|
-
return
|
|
418
|
+
const n = Y.current.find((r) => r.value === e);
|
|
419
|
+
return n && n.option;
|
|
420
420
|
},
|
|
421
421
|
[m]
|
|
422
422
|
), Qe = (e) => {
|
|
@@ -424,11 +424,11 @@ function zt(l, b) {
|
|
|
424
424
|
return;
|
|
425
425
|
if (F === void 0 || !m.has(F))
|
|
426
426
|
return W[X[0]];
|
|
427
|
-
const
|
|
428
|
-
return W[X[((e === "up" ?
|
|
427
|
+
const n = m.get(F)._index, r = X.indexOf(n), c = X.length;
|
|
428
|
+
return W[X[((e === "up" ? r - 1 : r + 1) + c) % c]];
|
|
429
429
|
}, Ce = (e, t = _e(e, g)) => {
|
|
430
|
-
let
|
|
431
|
-
const
|
|
430
|
+
let n = e;
|
|
431
|
+
const r = e === void 0 ? void 0 : Array.isArray(e) ? e.map(ue) : ue(e);
|
|
432
432
|
if (k && !t) {
|
|
433
433
|
const c = (p, h) => {
|
|
434
434
|
if (h)
|
|
@@ -441,15 +441,15 @@ function zt(l, b) {
|
|
|
441
441
|
} else if (U(P) && P.value === p)
|
|
442
442
|
return P.label;
|
|
443
443
|
};
|
|
444
|
-
Array.isArray(e) ?
|
|
444
|
+
Array.isArray(e) ? n = e.map((p, h) => ({
|
|
445
445
|
value: p,
|
|
446
|
-
label: c(p,
|
|
447
|
-
})) :
|
|
446
|
+
label: c(p, r[h])
|
|
447
|
+
})) : n = {
|
|
448
448
|
value: e,
|
|
449
|
-
label: c(e,
|
|
449
|
+
label: c(e, r)
|
|
450
450
|
};
|
|
451
451
|
}
|
|
452
|
-
return { option:
|
|
452
|
+
return { option: r, value: n };
|
|
453
453
|
}, z = (e) => {
|
|
454
454
|
if (Le(e), ne) {
|
|
455
455
|
const t = Ce(e);
|
|
@@ -457,13 +457,13 @@ function zt(l, b) {
|
|
|
457
457
|
}
|
|
458
458
|
}, We = (e, t) => {
|
|
459
459
|
if (t === "remove" || t === "add" && m.get(e)) {
|
|
460
|
-
const
|
|
461
|
-
if (z(
|
|
460
|
+
const n = t === "add" ? i.concat(e) : i.filter((c) => c !== e), r = t === "add" ? se : de;
|
|
461
|
+
if (z(n), typeof r == "function") {
|
|
462
462
|
const c = Ce(
|
|
463
463
|
e,
|
|
464
464
|
!1
|
|
465
465
|
);
|
|
466
|
-
|
|
466
|
+
r(
|
|
467
467
|
c.value,
|
|
468
468
|
c.option
|
|
469
469
|
);
|
|
@@ -511,15 +511,15 @@ function zt(l, b) {
|
|
|
511
511
|
])
|
|
512
512
|
), _t = () => {
|
|
513
513
|
var h, P;
|
|
514
|
-
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,
|
|
514
|
+
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__ */ x(
|
|
515
515
|
Mt,
|
|
516
516
|
{
|
|
517
517
|
id: Ke,
|
|
518
518
|
role: "listbox",
|
|
519
519
|
style: S,
|
|
520
|
-
className: ce(`${V}-popup-inner`,
|
|
521
|
-
ref:
|
|
522
|
-
data:
|
|
520
|
+
className: ce(`${V}-popup-inner`, N),
|
|
521
|
+
ref: Ne,
|
|
522
|
+
data: $e,
|
|
523
523
|
height: null,
|
|
524
524
|
isStaticItemHeight: !Ot,
|
|
525
525
|
measureLongestItem: e,
|
|
@@ -559,26 +559,25 @@ function zt(l, b) {
|
|
|
559
559
|
return d;
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
|
-
) : null, p =
|
|
562
|
+
) : null, p = n && !(_ && A) ? /* @__PURE__ */ x(
|
|
563
563
|
"div",
|
|
564
564
|
{
|
|
565
565
|
style: S,
|
|
566
|
-
className: ce(`${V}-popup-inner`,
|
|
567
|
-
children:
|
|
566
|
+
className: ce(`${V}-popup-inner`, N),
|
|
567
|
+
children: n
|
|
568
568
|
}
|
|
569
569
|
) : null;
|
|
570
570
|
return /* @__PURE__ */ it(
|
|
571
571
|
"div",
|
|
572
572
|
{
|
|
573
573
|
className: ce(`${V}-popup`, {
|
|
574
|
-
[`${V}-popup-hidden`]:
|
|
574
|
+
[`${V}-popup-hidden`]: r === null && p === null,
|
|
575
575
|
[`${V}-popup-multiple`]: g
|
|
576
576
|
}),
|
|
577
577
|
tabIndex: -1,
|
|
578
578
|
onKeyDown: (d) => Oe(d),
|
|
579
579
|
children: [
|
|
580
|
-
!!g && !!
|
|
581
|
-
/* @__PURE__ */ x(kt, { children: /* @__PURE__ */ x(
|
|
580
|
+
!!g && !!r && /* @__PURE__ */ x(kt, { children: /* @__PURE__ */ x(
|
|
582
581
|
st,
|
|
583
582
|
{
|
|
584
583
|
"aria-hidden": "true",
|
|
@@ -591,7 +590,7 @@ function zt(l, b) {
|
|
|
591
590
|
children: "全选"
|
|
592
591
|
}
|
|
593
592
|
) }),
|
|
594
|
-
typeof O == "function" ? O(
|
|
593
|
+
typeof O == "function" ? O(r || p) : r || p
|
|
595
594
|
]
|
|
596
595
|
}
|
|
597
596
|
);
|
|
@@ -600,13 +599,13 @@ function zt(l, b) {
|
|
|
600
599
|
const t = e.split(new RegExp(`[${Q.join("")}]`));
|
|
601
600
|
if (t.length > 1) {
|
|
602
601
|
fe.current = Date.now();
|
|
603
|
-
const
|
|
602
|
+
const n = t.filter(
|
|
604
603
|
(p, h) => p && t.indexOf(p) === h
|
|
605
|
-
),
|
|
604
|
+
), r = i.slice(0);
|
|
606
605
|
let c = !1;
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
}), c && z(
|
|
606
|
+
n.forEach((p) => {
|
|
607
|
+
r.indexOf(p) === -1 && (_ || m.get(p)) && (r.push(p), c = !0);
|
|
608
|
+
}), c && z(r);
|
|
610
609
|
}
|
|
611
610
|
}
|
|
612
611
|
return !!fe.current;
|
|
@@ -617,11 +616,11 @@ function zt(l, b) {
|
|
|
617
616
|
},
|
|
618
617
|
onKeyDown: (e) => {
|
|
619
618
|
if (e.target.tagName === "INPUT" && e.target.value) {
|
|
620
|
-
const t = e.key === nt.key,
|
|
621
|
-
if (
|
|
622
|
-
const
|
|
619
|
+
const t = e.key === nt.key, n = e.key === tt.key;
|
|
620
|
+
if (n || t) {
|
|
621
|
+
const r = n ? `
|
|
623
622
|
` : t ? " " : "";
|
|
624
|
-
Te(e.target.value +
|
|
623
|
+
Te(e.target.value + r) && Z("", "tokenSeparator");
|
|
625
624
|
}
|
|
626
625
|
}
|
|
627
626
|
Oe(e), Ae == null || Ae(e);
|
|
@@ -633,14 +632,14 @@ function zt(l, b) {
|
|
|
633
632
|
Te(e.clipboardData.getData("text")), Ve == null || Ve(e);
|
|
634
633
|
},
|
|
635
634
|
// Option Items
|
|
636
|
-
onRemoveCheckedItem: (e, t,
|
|
637
|
-
|
|
635
|
+
onRemoveCheckedItem: (e, t, n) => {
|
|
636
|
+
n.stopPropagation(), We(i[t], "remove");
|
|
638
637
|
},
|
|
639
638
|
onClear: (e) => {
|
|
640
639
|
if (e.stopPropagation(), g) {
|
|
641
|
-
const t = i.filter((
|
|
642
|
-
const
|
|
643
|
-
return
|
|
640
|
+
const t = i.filter((n) => {
|
|
641
|
+
const r = m.get(n);
|
|
642
|
+
return r && r.disabled;
|
|
644
643
|
});
|
|
645
644
|
z(t);
|
|
646
645
|
} else
|
|
@@ -651,7 +650,7 @@ function zt(l, b) {
|
|
|
651
650
|
At(
|
|
652
651
|
b,
|
|
653
652
|
() => {
|
|
654
|
-
var e
|
|
653
|
+
var e;
|
|
655
654
|
return {
|
|
656
655
|
dom: (e = E.current) == null ? void 0 : e.dom,
|
|
657
656
|
focus() {
|
|
@@ -663,9 +662,12 @@ function zt(l, b) {
|
|
|
663
662
|
hotkeyHandler: Oe,
|
|
664
663
|
activeOptionValue: F,
|
|
665
664
|
getOptionInfoByValue: ue,
|
|
666
|
-
getOptionInfoList: () => [...m.values()].filter((
|
|
665
|
+
getOptionInfoList: () => [...m.values()].filter((t) => t._valid),
|
|
667
666
|
scrollIntoView: ge,
|
|
668
|
-
getRootDOMNode
|
|
667
|
+
getRootDOMNode() {
|
|
668
|
+
var t, n;
|
|
669
|
+
return (n = (t = E.current) == null ? void 0 : t.getRootDOMNode) == null ? void 0 : n.call(t);
|
|
670
|
+
}
|
|
669
671
|
};
|
|
670
672
|
},
|
|
671
673
|
[
|
|
@@ -704,14 +706,14 @@ function zt(l, b) {
|
|
|
704
706
|
var t;
|
|
705
707
|
let e;
|
|
706
708
|
return (t = E.current) != null && t.dom && (e = new ResizeObserver(() => {
|
|
707
|
-
var
|
|
708
|
-
(
|
|
709
|
+
var n, r;
|
|
710
|
+
(r = (n = He.current) == null ? void 0 : n.updatePopupPosition) == null || r.call(n);
|
|
709
711
|
}), e.observe(E.current.dom)), () => {
|
|
710
|
-
var
|
|
711
|
-
(
|
|
712
|
+
var n, r, c;
|
|
713
|
+
(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;
|
|
712
714
|
};
|
|
713
715
|
}, [(Xe = E.current) == null ? void 0 : Xe.dom]), Fe != null ? Je(Fe) : /* @__PURE__ */ x(
|
|
714
|
-
|
|
716
|
+
Nt,
|
|
715
717
|
{
|
|
716
718
|
...u,
|
|
717
719
|
...bt,
|
|
@@ -728,28 +730,28 @@ function zt(l, b) {
|
|
|
728
730
|
onSort: z,
|
|
729
731
|
renderText: (e) => {
|
|
730
732
|
const t = ue(e);
|
|
731
|
-
let
|
|
733
|
+
let n = e;
|
|
732
734
|
if (St(M)) {
|
|
733
|
-
const
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
735
|
+
const r = Ce(e, !1);
|
|
736
|
+
n = M(
|
|
737
|
+
r.option || null,
|
|
738
|
+
r.value
|
|
737
739
|
);
|
|
738
740
|
} else {
|
|
739
|
-
let
|
|
741
|
+
let r = !1;
|
|
740
742
|
if (k) {
|
|
741
743
|
const c = u.value || u.defaultValue;
|
|
742
744
|
if (Array.isArray(c)) {
|
|
743
745
|
const p = c.find(
|
|
744
746
|
(h) => U(h) && h.value === e
|
|
745
747
|
);
|
|
746
|
-
p && (
|
|
747
|
-
} else U(c) && (
|
|
748
|
+
p && (n = p.label, r = !0);
|
|
749
|
+
} else U(c) && (n = c.label, r = !0);
|
|
748
750
|
}
|
|
749
|
-
!
|
|
751
|
+
!r && t && "children" in t && (n = t.children);
|
|
750
752
|
}
|
|
751
753
|
return {
|
|
752
|
-
text:
|
|
754
|
+
text: n,
|
|
753
755
|
disabled: t && t.disabled
|
|
754
756
|
};
|
|
755
757
|
},
|
|
@@ -5,7 +5,7 @@ import Y from "lodash/isNumber";
|
|
|
5
5
|
import Tt from "lodash/throttle";
|
|
6
6
|
import Rt, { createContext as St, forwardRef as st, useContext as _, useRef as w, useImperativeHandle as ct, useEffect as b, isValidElement as vt, useState as Pt, useCallback as j } from "react";
|
|
7
7
|
import Et from "../Affix.js";
|
|
8
|
-
import { a as lt } from "./
|
|
8
|
+
import { a as lt } from "./Lyg-9NEt.js";
|
|
9
9
|
import Mt from "../hooks/useIsFirstRender.js";
|
|
10
10
|
import at from "../hooks/useMergeProps.js";
|
|
11
11
|
import Ot from "../hooks/useStateWithPromise.js";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsxs as Se, jsx as E } from "react/jsx-runtime";
|
|
2
|
-
import { isEmptyValue as Ve, isEmptyArray as ve, isEmptyObject as Pe } from "@unicom-cloud/utils/is";
|
|
2
|
+
import { isPlainObject as ce, isEmptyValue as Ve, isEmptyArray as ve, isEmptyObject as Pe } from "@unicom-cloud/utils/is";
|
|
3
3
|
import Ke from "lodash/debounce";
|
|
4
4
|
import B from "lodash/isArray";
|
|
5
5
|
import F from "lodash/isFunction";
|
|
6
6
|
import Ie from "lodash/isNil";
|
|
7
|
-
import { forwardRef as ue, useRef as R, useCallback as K, useMemo as Y, useImperativeHandle as de, useContext as fe, useState as ee, useEffect as
|
|
8
|
-
import { a as he } from "./
|
|
7
|
+
import { forwardRef as ue, useRef as R, useCallback as K, useMemo as Y, useImperativeHandle as de, useContext as fe, useState as ee, useEffect as ie } from "react";
|
|
8
|
+
import { a as he } from "./Lyg-9NEt.js";
|
|
9
9
|
import _e from "../hooks/useId.js";
|
|
10
10
|
import Oe from "../hooks/useIsFirstRender.js";
|
|
11
11
|
import Te from "../hooks/useMergeProps.js";
|
|
12
|
-
import
|
|
12
|
+
import se from "../hooks/useMergeValue.js";
|
|
13
13
|
import xe from "../SelectView.js";
|
|
14
|
-
import { T as w, g as Le, a as Re, b as we } from "./
|
|
14
|
+
import { T as w, g as Le, a as Re, b as we } from "./DfMf16uZ.js";
|
|
15
15
|
import De from "../Trigger.js";
|
|
16
16
|
import Z from "@unicom-cloud/utils/class-name";
|
|
17
|
-
import
|
|
17
|
+
import "../utils/is.js";
|
|
18
18
|
import He from "lodash/isString";
|
|
19
19
|
import H from "lodash/get";
|
|
20
20
|
import Ne from "../hooks/useForceUpdate.js";
|
|
@@ -290,9 +290,9 @@ const ze = {
|
|
|
290
290
|
t,
|
|
291
291
|
ze,
|
|
292
292
|
h == null ? void 0 : h.TreeSelect
|
|
293
|
-
), u = Oe(), g = R(), l = R(null), v = R(null), C = R([]), [m] = Ue(e), d = Me(m, e.fieldNames), [_, D] = ee(), [T, q] =
|
|
293
|
+
), u = Oe(), g = R(), l = R(null), v = R(null), C = R([]), [m] = Ue(e), d = Me(m, e.fieldNames), [_, D] = ee(), [T, q] = se(!1, {
|
|
294
294
|
value: e.popupVisible
|
|
295
|
-
}), [S, J] =
|
|
295
|
+
}), [S, J] = se(
|
|
296
296
|
void 0,
|
|
297
297
|
// Compatible with previous behavior 'undefined as default'
|
|
298
298
|
{
|
|
@@ -330,7 +330,7 @@ const ze = {
|
|
|
330
330
|
[e.onSearch, m, d, e.filterTreeNode]
|
|
331
331
|
), re = K(() => {
|
|
332
332
|
let r = !0;
|
|
333
|
-
|
|
333
|
+
ce(e.showSearch) && (r = e.showSearch.retainInputValueWhileSelect !== !1), e.multiple && !r && S !== void 0 && G("", "optionChecked");
|
|
334
334
|
}, [S, e.multiple, JSON.stringify(e.showSearch)]), M = K(
|
|
335
335
|
(r, c) => {
|
|
336
336
|
p(r, c), re(), P || N(!1);
|
|
@@ -339,7 +339,7 @@ const ze = {
|
|
|
339
339
|
), ge = (r, c, k) => {
|
|
340
340
|
if (k.stopPropagation(), r.disabled)
|
|
341
341
|
return;
|
|
342
|
-
const V =
|
|
342
|
+
const V = ce(r.value) ? r.value.value : r.value;
|
|
343
343
|
if (!e.treeCheckable || e.treeCheckStrictly || !d[V]) {
|
|
344
344
|
const L = o.filter(($, j) => j !== c);
|
|
345
345
|
M(L, {
|
|
@@ -365,7 +365,7 @@ const ze = {
|
|
|
365
365
|
function Q(r) {
|
|
366
366
|
return Ve(r) || ve(r) || Pe(r);
|
|
367
367
|
}
|
|
368
|
-
|
|
368
|
+
ie(() => {
|
|
369
369
|
S !== void 0 && pe(S), S !== A.current && (A.current = S);
|
|
370
370
|
}, [S]);
|
|
371
371
|
const X = Y(() => {
|
|
@@ -377,7 +377,7 @@ const ze = {
|
|
|
377
377
|
}
|
|
378
378
|
return Array.from(new Set(r));
|
|
379
379
|
}, [S, d, _]);
|
|
380
|
-
|
|
380
|
+
ie(() => {
|
|
381
381
|
T ? setTimeout(() => {
|
|
382
382
|
const r = o[0];
|
|
383
383
|
l.current && r && l.current.scrollIntoView(r.value);
|
|
@@ -3,12 +3,12 @@ import en from "@unicom-cloud/icons/IconUiClose";
|
|
|
3
3
|
import we from "lodash/isFunction";
|
|
4
4
|
import nn, { forwardRef as Pe, useState as P, useImperativeHandle as tn, useRef as x, useContext as rn, useCallback as S, useEffect as te } from "react";
|
|
5
5
|
import Me from "../Button.js";
|
|
6
|
-
import { d as T, b as Ie, g as on, e as ln, f as sn, s as an, a as cn, I as un } from "./
|
|
6
|
+
import { d as T, b as Ie, g as on, e as ln, f as sn, s as an, a as cn, I as un } from "./Lyg-9NEt.js";
|
|
7
7
|
import dn from "../hooks/useMergeProps.js";
|
|
8
8
|
import fn from "../hooks/useMergeValue.js";
|
|
9
9
|
import mn from "../hooks/useOverflowHidden.js";
|
|
10
10
|
import pn from "../Portal.js";
|
|
11
|
-
import { P as Te } from "./
|
|
11
|
+
import { P as Te } from "./DQ3uFRJD.js";
|
|
12
12
|
import ye from "@unicom-cloud/utils/class-name";
|
|
13
13
|
import { isServerRendering as Cn, contains as hn } from "../utils/dom.js";
|
|
14
14
|
import { Esc as bn } from "../utils/keyCode.js";
|
|
@@ -290,7 +290,7 @@ function $n(n, a) {
|
|
|
290
290
|
}, 100));
|
|
291
291
|
}, We = (e) => {
|
|
292
292
|
var C;
|
|
293
|
-
|
|
293
|
+
const t = (C = l.onOk ?? l.onConfirm) == null ? void 0 : C(e);
|
|
294
294
|
t != null && t.then && (A(!0), t.then(
|
|
295
295
|
() => {
|
|
296
296
|
A(!1);
|
|
@@ -338,11 +338,12 @@ function $n(n, a) {
|
|
|
338
338
|
if (!k.current)
|
|
339
339
|
return;
|
|
340
340
|
e.preventDefault();
|
|
341
|
-
|
|
341
|
+
const t = _.current;
|
|
342
342
|
t.screenX = e.screenX, t.screenY = e.screenY, t.prewTranslateX = t.translateX, t.prewTranslateY = t.translateY, t.boundingClientRect = ((w = (C = k.current) == null ? void 0 : C.getBoundingClientRect) == null ? void 0 : w.call(C)) ?? {}, t.offsetParentBoundingClientRect = ((H = (N = (y = k.current) == null ? void 0 : y.offsetParent) == null ? void 0 : N.getBoundingClientRect) == null ? void 0 : H.call(N)) ?? {}, F(), Ke();
|
|
343
343
|
}, []), be = S((e) => {
|
|
344
344
|
e.preventDefault();
|
|
345
|
-
|
|
345
|
+
const t = _.current, { left: C, right: w, top: y, bottom: N } = t.boundingClientRect ?? {}, { width: H, height: Qe } = t.offsetParentBoundingClientRect ?? {};
|
|
346
|
+
let D = Math.max(e.screenX - t.screenX, -C);
|
|
346
347
|
D = Math.min(D, H - w);
|
|
347
348
|
let O = Math.max(e.screenY - t.screenY, -y);
|
|
348
349
|
O = Math.min(O, Qe - N), D += t.prewTranslateX, O += t.prewTranslateY, t.translateX = D, t.translateY = O, me(`translate(${D}px, ${O}px)`);
|
|
@@ -3,11 +3,11 @@ import pe from "@unicom-cloud/icons/IconUiClose";
|
|
|
3
3
|
import fe from "lodash/isFunction";
|
|
4
4
|
import he, { useContext as Ce, useRef as T, useState as d, useCallback as xe, useMemo as ye, useImperativeHandle as ke, useEffect as z } from "react";
|
|
5
5
|
import F from "../Button.js";
|
|
6
|
-
import { a as Ne, I as ge, b as B } from "./
|
|
6
|
+
import { a as Ne, I as ge, b as B } from "./Lyg-9NEt.js";
|
|
7
7
|
import be from "../hooks/useMergeProps.js";
|
|
8
8
|
import we from "../hooks/useOverflowHidden.js";
|
|
9
9
|
import Ie from "../Portal.js";
|
|
10
|
-
import { P as j } from "./
|
|
10
|
+
import { P as j } from "./DQ3uFRJD.js";
|
|
11
11
|
import b from "@unicom-cloud/utils/class-name";
|
|
12
12
|
import { isServerRendering as ve, contains as Pe } from "../utils/dom.js";
|
|
13
13
|
import { Esc as $e } from "../utils/keyCode.js";
|
|
@@ -3,12 +3,12 @@ import U from "@unicom-cloud/icons/IconUiCaretLeft";
|
|
|
3
3
|
import L from "@unicom-cloud/icons/IconUiCaretRight";
|
|
4
4
|
import V from "lodash/isFunction";
|
|
5
5
|
import M, { useContext as K, useRef as A, createContext as B } from "react";
|
|
6
|
-
import { a as T, I as S } from "./
|
|
6
|
+
import { a as T, I as S } from "./Lyg-9NEt.js";
|
|
7
7
|
import q from "../hooks/useMergeProps.js";
|
|
8
8
|
import D from "../hooks/useMergeValue.js";
|
|
9
9
|
import g from "@unicom-cloud/utils/class-name";
|
|
10
10
|
import G from "../utils/omit.js";
|
|
11
|
-
import {
|
|
11
|
+
import { u as J } from "./DQ3uFRJD.js";
|
|
12
12
|
import Q from "../hooks/useKeyboardEvent.js";
|
|
13
13
|
import { off as W, on as X } from "../utils/dom.js";
|
|
14
14
|
function Y(l, h) {
|