@unicom-cloud/ui 0.8.75 → 0.8.77
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 +1 -1
- package/Alert.js +1 -1
- package/AutoComplete.js +3 -5
- package/BackTop.js +1 -1
- package/Badge.js +1 -1
- 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 +6 -2
- package/Collapse.js +1 -1
- package/ColorPicker.js +3 -4
- package/Comment.js +1 -1
- package/ConfigProvider.js +2 -3
- package/Copy.js +1 -1
- package/DatePicker.js +1 -1
- package/Descriptions.js +1 -1
- package/Divider.js +1 -1
- package/Draggable.js +1 -1
- package/Dropdown.js +1 -1
- package/Empty.js +1 -1
- package/Icon.js +1 -1
- package/IconHover.js +1 -1
- package/Image.js +1 -1
- package/InputNumber.js +1 -1
- package/Layout.js +1 -1
- package/Link.js +1 -1
- package/List.js +5 -6
- package/Mentions.js +3 -4
- package/Menu.js +1 -1
- package/Message.js +1 -1
- package/Modal.js +1 -1
- package/Notice.js +1 -1
- package/Notification.js +1 -1
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/Pagination.js +2 -2
- package/Popconfirm.js +1 -1
- package/Popover.js +1 -1
- package/Progress.js +1 -1
- package/Radio.js +5 -4
- package/Rate.js +1 -1
- package/ResizeBox.js +1 -1
- package/Result.js +1 -1
- package/Select.js +5 -6
- package/Skeleton.js +1 -1
- package/Slider.js +1 -1
- package/Space.js +1 -1
- package/SpeechSynthesis.js +4 -3
- package/Spin.js +1 -1
- package/Statistic.js +1 -1
- package/Steps.js +1 -1
- package/Switch.js +1 -1
- package/Table.js +15 -16
- package/Tabs.js +1 -1
- package/Tag.js +1 -1
- package/Tooltip.js +2 -2
- package/Transfer.js +3 -4
- package/Tree.js +2 -3
- package/TreeSelect.js +3 -3
- package/Trigger.js +1 -1
- package/Typography.js +3 -3
- package/affix/index.js +86 -82
- package/alert/index.js +1 -1
- package/anchor/Anchor.js +1 -1
- package/anchor/Link.js +1 -1
- package/auto-complete/index.js +13 -147
- package/avatar/Avatar.js +1 -1
- package/avatar/Group.js +1 -1
- package/back-top/index.js +1 -1
- package/badge/index.js +1 -1
- package/breadcrumb/index.js +2 -2
- package/button/Group.js +1 -1
- package/button/index.js +1 -1
- package/calendar/index.js +12 -318
- package/card/Grid.js +1 -1
- package/card/Meta.js +1 -1
- package/card/index.js +1 -1
- package/carousel/Arrow.js +1 -1
- package/carousel/Indicator.js +1 -1
- package/carousel/index.js +1 -1
- package/cascader/Cascader.js +4 -4
- package/cascader/index.js +1 -1
- package/cascader/util.js +8 -8
- package/checkbox/Checkbox.js +7 -4
- package/checkbox/Group.js +5 -5
- package/checkbox/GroupBlock.js +8 -0
- package/checkbox/index.js +7 -2
- package/chunk/{BbqvFW5R.js → 9TSjT7x_.js} +112 -112
- package/chunk/ATwvJ8j2.js +6 -0
- package/chunk/{Dv6USvVF.js → BC5fEyWK.js} +2 -1
- package/chunk/{WVoGhvMI.js → BPQXH_5i.js} +32 -31
- package/chunk/{BPD5iNdA.js → CB4jGw4K.js} +22 -18
- package/chunk/{B8hkFIar.js → CBgu99gQ.js} +1 -1
- package/chunk/CBzE-PUr.js +23 -0
- package/chunk/CNcLypMY.js +723 -0
- package/chunk/{CPlPBkN7.js → C_4I3haT.js} +1 -1
- package/chunk/{0mWCmQHr.js → CjqvxJml.js} +2 -2
- package/chunk/Cwm8LL5p.js +7818 -0
- package/chunk/D0ZWT7db.js +5 -0
- package/chunk/{CWlklVfi.js → tpmioyz1.js} +1 -1
- package/collapse/Collapse.js +2 -2
- package/collapse/Item.js +2 -2
- package/collapse/index.js +1 -1
- package/color-picker/ControlBar.js +1 -1
- package/color-picker/InputAlpha.js +1 -1
- package/color-picker/InputHex.js +2 -2
- package/color-picker/InputRgb.js +2 -2
- package/color-picker/Palette.js +2 -2
- package/color-picker/Panel.js +15 -266
- package/color-picker/colors.js +4 -4
- package/color-picker/index.js +13 -268
- package/color-picker/utils.js +1 -1
- package/comment/index.js +1 -1
- package/config-provider/ConfigProvider.js +4 -6
- package/config-provider/context.js +3 -2
- package/config-provider/index.js +4 -5
- package/copy/index.js +1 -1
- package/date-picker/Picker.js +1 -1
- package/date-picker/PickerRange.js +2 -2
- package/date-picker/index.js +1 -1
- package/descriptions/index.js +1 -1
- package/divider/index.js +1 -1
- package/draggable/index.js +1 -1
- package/drawer/Drawer.js +30 -21
- package/dropdown/Button.js +1 -1
- package/dropdown/index.js +1 -1
- package/empty/index.js +1 -1
- package/form/Form.js +10 -10
- package/form/FormItem.js +1 -1
- package/form/context.js +1 -1
- package/grid/Col.js +1 -1
- package/grid/Row.js +1 -1
- package/grid/grid-item.js +1 -1
- package/grid/grid.js +1 -1
- package/hooks/index.js +1 -1
- package/hooks/useWindowSize.js +1 -1
- package/icon/index.js +1 -1
- package/icon-hover/index.js +1 -1
- package/image/Image.js +2 -2
- package/image/ImagePreview.js +2 -2
- package/image/ImagePreviewArrow.js +1 -1
- package/image/ImagePreviewGroup.js +1 -1
- package/image/index.js +1 -1
- package/index.js +453 -463
- package/input/Group.js +1 -1
- package/input/Input.js +1 -1
- package/input/InputElement.js +1 -1
- package/input/Password.js +1 -1
- package/input/Search.js +1 -1
- package/input/Textarea.js +1 -1
- package/input-number/index.js +1 -1
- package/input-tag/InputTag.js +1 -1
- package/layout/Content.js +1 -1
- package/layout/Footer.js +1 -1
- package/layout/Header.js +1 -1
- package/layout/Sider.js +1 -1
- package/layout/index.js +1 -1
- package/link/index.js +1 -1
- package/list/Item.js +1 -1
- package/list/Meta.js +1 -1
- package/list/index.js +17 -267
- package/mentions/index.js +11 -144
- package/menu/Menu.js +2 -2
- package/menu/OverflowWrap.js +1 -1
- package/menu/index.js +2 -2
- package/message/index.js +1 -1
- package/message/useMessage.js +1 -1
- package/modal/Confirm.js +2 -2
- package/modal/Modal.js +2 -2
- package/modal/index.js +1 -1
- package/notice/index.js +1 -1
- package/notification/index.js +1 -1
- package/notification/useNotification.js +1 -1
- package/overflow-ellipsis/OverflowItem.js +1 -1
- package/overflow-ellipsis/index.js +1 -1
- package/package.json +1 -1
- package/page-header/index.js +1 -1
- package/pagination/PageItem.js +1 -1
- package/pagination/PageJumper.js +1 -1
- package/pagination/PageOption.js +5 -45
- package/pagination/Pagination.js +11 -243
- package/pagination/index.js +2 -2
- package/picker/Input.js +1 -1
- package/picker/InputRange.js +1 -1
- package/popconfirm/index.js +1 -1
- package/popover/index.js +1 -1
- package/progress/index.js +1 -1
- package/radio/Group.js +5 -5
- package/radio/GroupBlock.js +9 -0
- package/radio/Radio.js +6 -5
- package/radio/index.js +4 -3
- package/rate/index.js +1 -1
- package/resize-box/ResizeTrigger.js +1 -1
- package/resize-box/Split.js +1 -1
- package/resize-box/SplitGroup.js +1 -1
- package/resize-box/index.js +1 -1
- package/result/index.js +1 -1
- package/select/Option.js +6 -93
- package/select/Select.js +23 -546
- package/select/index.js +3 -3
- package/select/util.js +18 -139
- package/select-view/Core.js +1 -1
- package/skeleton/index.js +1 -1
- package/slider/Button.js +1 -1
- package/slider/index.js +1 -1
- package/space/index.js +1 -1
- package/speech-synthesis/index.js +4 -3
- package/spin/DotLoading.js +1 -1
- package/spin/index.js +1 -1
- package/statistic/Countdown.js +1 -1
- package/statistic/index.js +1 -1
- package/steps/index.js +1 -1
- package/style/variables.less +0 -484
- package/style.css +1 -1
- package/switch/index.js +1 -1
- package/table/Table.js +2 -3
- package/table/index.js +15 -109
- package/tabs/Tab.js +2 -2
- package/tabs/TabContent.js +2 -2
- package/tabs/TabPane.js +1 -1
- package/tabs/index.js +2 -2
- package/tag/index.js +1 -1
- package/time-picker/Picker.js +1 -1
- package/time-picker/TimePicker.js +1 -1
- package/timeline/Item.js +1 -1
- package/timeline/Timeline.js +1 -1
- package/tooltip/index.js +2 -2
- package/transfer/Item.js +9 -104
- package/transfer/List.js +13 -184
- package/transfer/index.js +13 -180
- package/tree/Animation.js +2 -2
- package/tree/Node.js +3 -4
- package/tree/NodeList.js +6 -80
- package/tree/Tree.js +17 -578
- package/tree/index.js +2 -3
- package/tree-select/List.js +6 -122
- package/tree-select/Select.js +22 -392
- package/tree-select/index.js +3 -3
- package/trigger/index.js +1 -1
- package/types/checkbox/Checkbox.d.ts +5 -2
- package/types/checkbox/GroupBlock.d.ts +7 -0
- package/types/checkbox/index.d.ts +2 -1
- package/types/config-provider/ConfigProvider.d.ts +0 -27
- package/types/config-provider/interface.d.ts +3 -1
- package/types/index.d.ts +2 -2
- package/types/menu/context.d.ts +1 -1
- package/types/radio/GroupBlock.d.ts +7 -0
- package/types/radio/Radio.d.ts +5 -3
- package/types/utils/constant.d.ts +2 -1
- package/types/utils/index.d.ts +1 -0
- package/types/utils/setDarkTheme.d.ts +2 -3
- package/types/utils/setPrimaryColor.d.ts +2 -0
- package/typography/Base.js +1 -1
- package/typography/Ellipsis.js +9 -22
- package/typography/Paragraph.js +1 -1
- package/typography/Typography.js +1 -1
- package/typography/index.js +10 -276
- package/upload/TriggerNode.js +1 -1
- package/upload/Upload.js +1 -1
- package/upload/Uploader.js +43 -44
- package/upload/request.js +1 -1
- package/upload/request_.js +1 -1
- package/utils/caseName.js +1 -1
- package/utils/color.js +1 -1
- package/utils/constant.js +7 -5
- package/utils/contextHolder.js +1 -1
- package/utils/dom.js +1 -1
- package/utils/index.js +199 -195
- package/utils/setDarkTheme.js +34 -5
- package/utils/setPrimaryColor.js +26 -0
- package/utils/tinycolor.js +1 -1
- package/verification-code/VerificationCode.js +1 -1
- package/version/index.js +1 -1
- package/watermark/Watermark.js +1 -1
- package/chunk/BViFMHr-.js +0 -1820
- package/chunk/BsWphzcT.js +0 -20
- package/chunk/BxZ39GzB.js +0 -209
- package/chunk/C9XYyypq.js +0 -713
- package/chunk/CIkPwQlq.js +0 -6
- package/chunk/DFcz9ZPP.js +0 -1020
- package/chunk/DeCsZrXb.js +0 -310
- package/chunk/DskaI8QL.js +0 -25
- package/chunk/EL5Jmjgr.js +0 -170
package/select/Option.js
CHANGED
|
@@ -1,95 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
function P(l, _) {
|
|
7
|
-
const {
|
|
8
|
-
style: b,
|
|
9
|
-
className: k,
|
|
10
|
-
wrapperClassName: x,
|
|
11
|
-
disabled: a,
|
|
12
|
-
prefixCls: e,
|
|
13
|
-
rtl: w,
|
|
14
|
-
value: f,
|
|
15
|
-
children: h,
|
|
16
|
-
_isMultipleMode: $,
|
|
17
|
-
_isUserCreatedOption: N,
|
|
18
|
-
_isUserCreatingOption: g,
|
|
19
|
-
_valueActive: M,
|
|
20
|
-
_valueSelect: O,
|
|
21
|
-
_onMouseEnter: c,
|
|
22
|
-
_onMouseLeave: d,
|
|
23
|
-
_onClick: u,
|
|
24
|
-
...o
|
|
25
|
-
} = l, i = "value" in l ? f : `${h}`, n = "children" in l ? h : `${f}`, s = $ ? O.indexOf(i) !== -1 : O === i, m = {
|
|
26
|
-
style: b,
|
|
27
|
-
className: v(
|
|
28
|
-
`${e}-option`,
|
|
29
|
-
{
|
|
30
|
-
[`${e}-option-selected`]: s,
|
|
31
|
-
[`${e}-option-disabled`]: a,
|
|
32
|
-
[`${e}-option-hover`]: i === M,
|
|
33
|
-
[`${e}-option-empty`]: !n && n !== 0 || typeof n == "string" && /^\s*$/.test(n),
|
|
34
|
-
[`${e}-option-rtl`]: w
|
|
35
|
-
},
|
|
36
|
-
k
|
|
37
|
-
),
|
|
38
|
-
onMouseEnter: (r) => {
|
|
39
|
-
var t;
|
|
40
|
-
c == null || c(i), (t = o.onMouseEnter) == null || t.call(o, r);
|
|
41
|
-
},
|
|
42
|
-
onMouseLeave: (r) => {
|
|
43
|
-
var t;
|
|
44
|
-
d == null || d(), (t = o.onMouseLeave) == null || t.call(o, r);
|
|
45
|
-
},
|
|
46
|
-
onClick: (r) => {
|
|
47
|
-
var t;
|
|
48
|
-
u == null || u(i, a), (t = o.onClick) == null || t.call(o, r);
|
|
49
|
-
},
|
|
50
|
-
...L(o, [
|
|
51
|
-
"_key",
|
|
52
|
-
"extra",
|
|
53
|
-
"isSelectOption",
|
|
54
|
-
"onClick",
|
|
55
|
-
"onMouseEnter",
|
|
56
|
-
"onMouseLeave"
|
|
57
|
-
])
|
|
58
|
-
}, p = {
|
|
59
|
-
ref: _,
|
|
60
|
-
role: "option",
|
|
61
|
-
"aria-selected": s
|
|
62
|
-
};
|
|
63
|
-
return N && Object.assign(p, { "data-user-created": !0 }), g && Object.assign(p, { "data-user-creating": !0 }), $ ? /* @__PURE__ */ j(
|
|
64
|
-
"li",
|
|
65
|
-
{
|
|
66
|
-
...p,
|
|
67
|
-
className: v(
|
|
68
|
-
`${e}-option-wrapper`,
|
|
69
|
-
{
|
|
70
|
-
[`${e}-option-wrapper-selected`]: s,
|
|
71
|
-
[`${e}-option-wrapper-disabled`]: a
|
|
72
|
-
},
|
|
73
|
-
x
|
|
74
|
-
),
|
|
75
|
-
children: [
|
|
76
|
-
/* @__PURE__ */ C(
|
|
77
|
-
E,
|
|
78
|
-
{
|
|
79
|
-
"aria-hidden": "true",
|
|
80
|
-
className: `${e}-checkbox`,
|
|
81
|
-
checked: s,
|
|
82
|
-
disabled: a,
|
|
83
|
-
onChange: m.onClick
|
|
84
|
-
}
|
|
85
|
-
),
|
|
86
|
-
/* @__PURE__ */ C("span", { ...m, children: n })
|
|
87
|
-
]
|
|
88
|
-
}
|
|
89
|
-
) : /* @__PURE__ */ C("li", { ...p, ...m, children: n });
|
|
90
|
-
}
|
|
91
|
-
const R = y.forwardRef(P), S = R;
|
|
92
|
-
S.__PQB_SELECT_OPTION__ = !0;
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { O as a } from "../chunk/Cwm8LL5p.js";
|
|
4
|
+
import "../chunk/CUFsOxJ2.js";
|
|
5
|
+
import "../chunk/BKKEev13.js";
|
|
93
6
|
export {
|
|
94
|
-
|
|
7
|
+
a as default
|
|
95
8
|
};
|
package/select/Select.js
CHANGED
|
@@ -1,550 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "lodash/isArray";
|
|
3
|
+
import "lodash/isFunction";
|
|
4
|
+
import "react";
|
|
5
|
+
import { O as j, S as k } from "../chunk/Cwm8LL5p.js";
|
|
6
|
+
import "../chunk/CNcLypMY.js";
|
|
7
|
+
import "../chunk/B4YRLi8r.js";
|
|
8
|
+
import "../chunk/BFTV6myl.js";
|
|
9
|
+
import "../chunk/DeV0v__J.js";
|
|
10
|
+
import "../select-view/index.js";
|
|
11
|
+
import "../trigger/index.js";
|
|
12
|
+
import "../chunk/CUFsOxJ2.js";
|
|
13
|
+
import "../chunk/Dh7Osrvr.js";
|
|
14
14
|
import "../chunk/DAAff-FT.js";
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import Tt from "./Option.js";
|
|
22
|
-
import { getValidValue as Ge, flatChildren as Ut, isEmpty as de, preventDefaultEvent as Pt, isSelectOptGroup as Dt, isSelectOption as Rt } from "./util.js";
|
|
15
|
+
import "../chunk/BrOW642m.js";
|
|
16
|
+
import "../chunk/BKKEev13.js";
|
|
17
|
+
import "../chunk/CIRG541s.js";
|
|
18
|
+
import "../utils/warning.js";
|
|
19
|
+
import "../virtual-list/VirtualList.js";
|
|
20
|
+
import { default as v } from "./OptGroup.js";
|
|
23
21
|
import "../chunk/C0pRaDCf.js";
|
|
24
|
-
import
|
|
25
|
-
const je = "userCreatingOption", Ht = {
|
|
26
|
-
trigger: "click",
|
|
27
|
-
bordered: !0,
|
|
28
|
-
filterOption: !0,
|
|
29
|
-
unmountOnExit: !0,
|
|
30
|
-
defaultActiveFirstOption: !0,
|
|
31
|
-
allowCheckAll: !0
|
|
32
|
-
}, $t = { bottom: 4 };
|
|
33
|
-
function Gt(Ke, We) {
|
|
34
|
-
var Te;
|
|
35
|
-
const { getPrefixCls: qe, renderEmpty: ze, componentConfig: q, rtl: ge } = Ct(bt), u = kt(
|
|
36
|
-
Ke,
|
|
37
|
-
Ht,
|
|
38
|
-
q == null ? void 0 : q.Select
|
|
39
|
-
), {
|
|
40
|
-
children: Oe,
|
|
41
|
-
renderFormat: he,
|
|
42
|
-
defaultActiveFirstOption: Ce,
|
|
43
|
-
disabled: Be,
|
|
44
|
-
unmountOnExit: Je,
|
|
45
|
-
notFoundContent: Qe,
|
|
46
|
-
showSearch: ve,
|
|
47
|
-
tokenSeparators: z,
|
|
48
|
-
options: ye,
|
|
49
|
-
filterOption: be,
|
|
50
|
-
labelInValue: P,
|
|
51
|
-
getPopupContainer: Xe,
|
|
52
|
-
trigger: Ye,
|
|
53
|
-
triggerElement: B,
|
|
54
|
-
triggerProps: c,
|
|
55
|
-
dropdownRender: Ve,
|
|
56
|
-
dropdownMenuStyle: ke,
|
|
57
|
-
dropdownMenuClassName: xe,
|
|
58
|
-
virtualListProps: D,
|
|
59
|
-
// events
|
|
60
|
-
onChange: we,
|
|
61
|
-
onSelect: Ze,
|
|
62
|
-
onDeselect: et,
|
|
63
|
-
onClear: J,
|
|
64
|
-
onSearch: Q,
|
|
65
|
-
onFocus: tt,
|
|
66
|
-
onBlur: X,
|
|
67
|
-
onPopupScroll: Y,
|
|
68
|
-
onVisibleChange: Z,
|
|
69
|
-
onInputValueChange: ee,
|
|
70
|
-
onPaste: te,
|
|
71
|
-
onKeyDown: ne
|
|
72
|
-
} = u;
|
|
73
|
-
let { mode: re, allowCheckAll: Se, allowCreate: d } = u;
|
|
74
|
-
re === "tags" && (re = "multiple", d = !0, Mt(
|
|
75
|
-
!0,
|
|
76
|
-
`[Pqb Select] The 'tags' mode will be removed in the next major version, please use {mode: "multiple", allowCreate: true} instead.`
|
|
77
|
-
));
|
|
78
|
-
const m = qe("select"), p = re === "multiple";
|
|
79
|
-
p || (Se = !1);
|
|
80
|
-
const [nt, oe] = W(
|
|
81
|
-
Ge(u.defaultValue, p, P)
|
|
82
|
-
), o = "value" in u ? Ge(u.value, p, P) : nt, [g, rt, ot] = Re("", {
|
|
83
|
-
value: "inputValue" in u ? u.inputValue || "" : void 0
|
|
84
|
-
}), [O, it] = Re(!1, {
|
|
85
|
-
defaultValue: u.defaultPopupVisible,
|
|
86
|
-
value: "popupVisible" in u ? u.popupVisible : c && "popupVisible" in c ? c.popupVisible : void 0
|
|
87
|
-
}), [M, lt] = W(null), [N, st] = W([]), [C, E] = W(
|
|
88
|
-
U(o) ? o[0] : o
|
|
89
|
-
), {
|
|
90
|
-
childrenList: ie,
|
|
91
|
-
optionInfoMap: a,
|
|
92
|
-
optionValueList: k,
|
|
93
|
-
optionIndexListForArrowKey: w,
|
|
94
|
-
hasOptGroup: at,
|
|
95
|
-
hasComplexLabelInOptions: ut
|
|
96
|
-
} = De(() => Ut(
|
|
97
|
-
{ children: Oe, options: ye, filterOption: be },
|
|
98
|
-
{
|
|
99
|
-
prefixCls: m,
|
|
100
|
-
inputValue: g,
|
|
101
|
-
userCreatedOptions: N,
|
|
102
|
-
userCreatingOption: M
|
|
103
|
-
}
|
|
104
|
-
), [
|
|
105
|
-
Oe,
|
|
106
|
-
ye,
|
|
107
|
-
be,
|
|
108
|
-
g,
|
|
109
|
-
M,
|
|
110
|
-
N
|
|
111
|
-
]), le = b(null), Ae = b(null), y = b(null), S = b([]), x = b(null), Ie = b(g), se = b(null), R = b(0), ae = b(!1), _e = Vt(`${m}-popup-`), H = de(o, p), Ee = De(() => {
|
|
112
|
-
var e, t;
|
|
113
|
-
if (Ce) {
|
|
114
|
-
const n = U(o) ? o[0] : o, r = !H && ((e = a.get(n)) == null ? void 0 : e._valid), l = ((t = a == null ? void 0 : a.get(k[0])) == null ? void 0 : t._origin) === je;
|
|
115
|
-
return r && !l ? n : k[w[0]];
|
|
116
|
-
}
|
|
117
|
-
}, [
|
|
118
|
-
o,
|
|
119
|
-
a,
|
|
120
|
-
k,
|
|
121
|
-
w,
|
|
122
|
-
Ce,
|
|
123
|
-
H
|
|
124
|
-
]), $ = pe(
|
|
125
|
-
(e, t) => {
|
|
126
|
-
var r;
|
|
127
|
-
const n = a.get(e);
|
|
128
|
-
le.current && ((r = n == null ? void 0 : n.child) != null && r.props) && le.current.scrollTo({
|
|
129
|
-
key: n.child.props._key,
|
|
130
|
-
options: t
|
|
131
|
-
});
|
|
132
|
-
},
|
|
133
|
-
[a]
|
|
134
|
-
), G = pe(
|
|
135
|
-
(e, t = !1) => v(d) && typeof (d == null ? void 0 : d.formatter) == "function" ? d.formatter(e, t) : e,
|
|
136
|
-
[d]
|
|
137
|
-
), A = (e, t) => {
|
|
138
|
-
(e !== Ie.current || t !== se.current) && (rt(e), Ie.current = e, se.current = t, ee == null || ee(e, t));
|
|
139
|
-
}, F = (e) => {
|
|
140
|
-
var t;
|
|
141
|
-
O !== e && (it(e), Z == null || Z(e), (t = c == null ? void 0 : c.onVisibleChange) == null || t.call(c, e));
|
|
142
|
-
};
|
|
143
|
-
V(() => {
|
|
144
|
-
p ? Array.isArray(o) || oe(o === void 0 ? [] : [o]) : Array.isArray(o) && oe(o.length === 0 ? void 0 : o[0]);
|
|
145
|
-
}, [p, o]), V(() => {
|
|
146
|
-
if (O) {
|
|
147
|
-
E(Ee);
|
|
148
|
-
const e = U(o) ? o[0] : o;
|
|
149
|
-
!H && a.has(e) && setTimeout(() => $(e));
|
|
150
|
-
}
|
|
151
|
-
}, [O]), V(() => {
|
|
152
|
-
(x.current === "up" || x.current === "down") && ($(C), x.current = "none");
|
|
153
|
-
}, [C]), V(() => {
|
|
154
|
-
E(Ee);
|
|
155
|
-
}, [JSON.stringify(ie.map((e) => {
|
|
156
|
-
var t;
|
|
157
|
-
return (t = e == null ? void 0 : e.props) == null ? void 0 : t.value;
|
|
158
|
-
}))]), V(() => {
|
|
159
|
-
S.current = S.current.filter((e) => p ? U(o) && o.indexOf(e.value) > -1 : e.value === o);
|
|
160
|
-
}, [o, p]), V(() => {
|
|
161
|
-
if (d) {
|
|
162
|
-
let e;
|
|
163
|
-
if (de(o, p))
|
|
164
|
-
e = [];
|
|
165
|
-
else {
|
|
166
|
-
const n = Array.isArray(o) ? o : [o], r = n.filter((i) => {
|
|
167
|
-
var h;
|
|
168
|
-
const f = a.get(i) || ((h = S.current.find((s) => s.value === i)) == null ? void 0 : h.option);
|
|
169
|
-
return !f || f._origin === je;
|
|
170
|
-
}).map((i) => G(i));
|
|
171
|
-
e = N.filter((i) => {
|
|
172
|
-
const f = v(i) ? i.value : i;
|
|
173
|
-
return n.indexOf(f) !== -1;
|
|
174
|
-
}).concat(
|
|
175
|
-
r
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
const t = (n) => n.map((r) => v(r) ? r.value : r).toString();
|
|
179
|
-
t(e) !== t(N) && st(e);
|
|
180
|
-
}
|
|
181
|
-
}, [o, d, p, G]), V(() => {
|
|
182
|
-
d && lt(
|
|
183
|
-
g && !a.has(g) ? G(g, !0) : null
|
|
184
|
-
);
|
|
185
|
-
}, [g, G]), V(() => {
|
|
186
|
-
const { current: e } = se;
|
|
187
|
-
ot === g && (e === "manual" || e === "optionListHide") && (Q == null || Q(g, e));
|
|
188
|
-
}, [g]);
|
|
189
|
-
const L = pe(
|
|
190
|
-
(e) => {
|
|
191
|
-
const t = a.get(e);
|
|
192
|
-
if (t) {
|
|
193
|
-
const r = S.current.findIndex(
|
|
194
|
-
(l) => l.value === e
|
|
195
|
-
);
|
|
196
|
-
return r > -1 ? S.current.splice(r, 1, { value: e, option: t }) : S.current.push({ value: e, option: t }), t;
|
|
197
|
-
}
|
|
198
|
-
const n = S.current.find((r) => r.value === e);
|
|
199
|
-
return n && n.option;
|
|
200
|
-
},
|
|
201
|
-
[a]
|
|
202
|
-
), Fe = (e) => {
|
|
203
|
-
if (!w.length)
|
|
204
|
-
return;
|
|
205
|
-
if (C === void 0 || !a.has(C))
|
|
206
|
-
return k[w[0]];
|
|
207
|
-
const n = a.get(C)._index, r = w.indexOf(n), l = w.length;
|
|
208
|
-
return k[w[((e === "up" ? r - 1 : r + 1) + l) % l]];
|
|
209
|
-
}, j = (e, t = de(e, p)) => {
|
|
210
|
-
let n = e;
|
|
211
|
-
const r = e === void 0 ? void 0 : Array.isArray(e) ? e.map(L) : L(e);
|
|
212
|
-
if (P && !t) {
|
|
213
|
-
const l = (i, f) => {
|
|
214
|
-
if (f)
|
|
215
|
-
return f.children;
|
|
216
|
-
const h = "value" in u ? u.value : "defaultValue" in u ? u.defaultValue : null;
|
|
217
|
-
if (Array.isArray(h)) {
|
|
218
|
-
for (const s of h)
|
|
219
|
-
if (v(s) && s.value === i)
|
|
220
|
-
return s.label;
|
|
221
|
-
} else if (v(h) && h.value === i)
|
|
222
|
-
return h.label;
|
|
223
|
-
};
|
|
224
|
-
Array.isArray(e) ? n = e.map((i, f) => ({
|
|
225
|
-
value: i,
|
|
226
|
-
label: l(i, r[f])
|
|
227
|
-
})) : n = {
|
|
228
|
-
value: e,
|
|
229
|
-
label: l(e, r)
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
return { option: r, value: n };
|
|
233
|
-
}, I = (e) => {
|
|
234
|
-
if (oe(e), we) {
|
|
235
|
-
const t = j(e);
|
|
236
|
-
we(t.value, t.option);
|
|
237
|
-
}
|
|
238
|
-
}, Me = (e, t) => {
|
|
239
|
-
if (t === "remove" || t === "add" && a.get(e)) {
|
|
240
|
-
const n = t === "add" ? o.concat(e) : o.filter((l) => l !== e), r = t === "add" ? Ze : et;
|
|
241
|
-
if (I(n), typeof r == "function") {
|
|
242
|
-
const l = j(
|
|
243
|
-
e,
|
|
244
|
-
!1
|
|
245
|
-
);
|
|
246
|
-
r(
|
|
247
|
-
l.value,
|
|
248
|
-
l.option
|
|
249
|
-
);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
}, Ne = (e, t) => {
|
|
253
|
-
t || (p ? (Me(
|
|
254
|
-
e,
|
|
255
|
-
o.indexOf(e) === -1 ? "add" : "remove"
|
|
256
|
-
), (!v(ve) || !ve.retainInputValueWhileSelect) && A("", "optionChecked")) : (e !== o && I(e), setTimeout(() => {
|
|
257
|
-
F(!1);
|
|
258
|
-
})));
|
|
259
|
-
}, K = St(
|
|
260
|
-
/* @__PURE__ */ new Map([
|
|
261
|
-
[At.key, () => F(!1)],
|
|
262
|
-
[
|
|
263
|
-
He.key,
|
|
264
|
-
() => {
|
|
265
|
-
if (O) {
|
|
266
|
-
const e = a.get(C);
|
|
267
|
-
e && Ne(C, e.disabled);
|
|
268
|
-
} else
|
|
269
|
-
F(!0);
|
|
270
|
-
}
|
|
271
|
-
],
|
|
272
|
-
[
|
|
273
|
-
$e.key,
|
|
274
|
-
// 按tab键切换,关闭开启的弹出框
|
|
275
|
-
() => F(!1)
|
|
276
|
-
],
|
|
277
|
-
[
|
|
278
|
-
It.key,
|
|
279
|
-
() => {
|
|
280
|
-
if (O)
|
|
281
|
-
return x.current = "up", E(Fe("up")), !1;
|
|
282
|
-
}
|
|
283
|
-
],
|
|
284
|
-
[
|
|
285
|
-
_t.key,
|
|
286
|
-
() => {
|
|
287
|
-
if (O)
|
|
288
|
-
return x.current = "down", E(Fe("down")), !1;
|
|
289
|
-
}
|
|
290
|
-
]
|
|
291
|
-
])
|
|
292
|
-
), ct = () => {
|
|
293
|
-
var f, h;
|
|
294
|
-
const e = (c == null ? void 0 : c.autoAlignPopupWidth) === !1 && (!((f = c == null ? void 0 : c.style) != null && f.width) || ((h = c == null ? void 0 : c.style) == null ? void 0 : h.width) === "auto"), t = e && ut, n = "notFoundContent" in u ? Qe : ze("Select"), r = ie.length ? /* @__PURE__ */ _(
|
|
295
|
-
Nt,
|
|
296
|
-
{
|
|
297
|
-
id: _e,
|
|
298
|
-
role: "listbox",
|
|
299
|
-
style: ke,
|
|
300
|
-
className: fe(`${m}-popup-inner`, xe),
|
|
301
|
-
ref: le,
|
|
302
|
-
data: ie,
|
|
303
|
-
height: null,
|
|
304
|
-
isStaticItemHeight: !at,
|
|
305
|
-
measureLongestItem: e,
|
|
306
|
-
itemKey: (s) => s.props._key,
|
|
307
|
-
onMouseDown: Pt,
|
|
308
|
-
onMouseMove: () => {
|
|
309
|
-
x.current = null;
|
|
310
|
-
},
|
|
311
|
-
onScroll: (s) => Y == null ? void 0 : Y(s.target),
|
|
312
|
-
...D,
|
|
313
|
-
threshold: t ? null : D == null ? void 0 : D.threshold,
|
|
314
|
-
children: (s) => {
|
|
315
|
-
var Ue;
|
|
316
|
-
if (Dt(s))
|
|
317
|
-
return /* @__PURE__ */ _(s.type, { ...s.props, prefixCls: m });
|
|
318
|
-
if (Rt(s)) {
|
|
319
|
-
const Pe = (Ue = s.props) == null ? void 0 : Ue.value, ft = v(M) ? M.value : M, dt = N.map(
|
|
320
|
-
(T) => v(T) ? T.value : T
|
|
321
|
-
), mt = {
|
|
322
|
-
prefixCls: m,
|
|
323
|
-
rtl: ge,
|
|
324
|
-
_valueActive: C,
|
|
325
|
-
_valueSelect: o,
|
|
326
|
-
_isMultipleMode: p,
|
|
327
|
-
_isUserCreatingOption: d && ft === Pe,
|
|
328
|
-
_isUserCreatedOption: d && dt.indexOf(Pe) > -1,
|
|
329
|
-
_onClick: Ne,
|
|
330
|
-
_onMouseEnter: (T) => {
|
|
331
|
-
x.current === null && E(T);
|
|
332
|
-
},
|
|
333
|
-
_onMouseLeave: () => {
|
|
334
|
-
x.current === null && E(void 0);
|
|
335
|
-
}
|
|
336
|
-
};
|
|
337
|
-
return s && /* @__PURE__ */ _(s.type, { ...s.props, ...mt });
|
|
338
|
-
}
|
|
339
|
-
return s;
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
) : null, i = n && !(d && g) ? /* @__PURE__ */ _(
|
|
343
|
-
"div",
|
|
344
|
-
{
|
|
345
|
-
style: ke,
|
|
346
|
-
className: fe(`${m}-popup-inner`, xe),
|
|
347
|
-
children: n
|
|
348
|
-
}
|
|
349
|
-
) : null;
|
|
350
|
-
return /* @__PURE__ */ gt(
|
|
351
|
-
"div",
|
|
352
|
-
{
|
|
353
|
-
className: fe(`${m}-popup`, {
|
|
354
|
-
[`${m}-popup-hidden`]: r === null && i === null,
|
|
355
|
-
[`${m}-popup-multiple`]: p
|
|
356
|
-
}),
|
|
357
|
-
tabIndex: -1,
|
|
358
|
-
onKeyDown: (s) => K(s),
|
|
359
|
-
children: [
|
|
360
|
-
!!p && !!r && !!Se && // 潘启宝添加
|
|
361
|
-
/* @__PURE__ */ _(
|
|
362
|
-
yt,
|
|
363
|
-
{
|
|
364
|
-
"aria-hidden": "true",
|
|
365
|
-
className: `${m}-checkbox ${m}-checkbox-all`,
|
|
366
|
-
checked: k.length === o.length,
|
|
367
|
-
indeterminate: k.length !== o.length && o.length !== 0,
|
|
368
|
-
onChange: (s) => {
|
|
369
|
-
I(s ? [...k] : []);
|
|
370
|
-
},
|
|
371
|
-
children: "全选"
|
|
372
|
-
}
|
|
373
|
-
),
|
|
374
|
-
typeof Ve == "function" ? Ve(r || i) : r || i
|
|
375
|
-
]
|
|
376
|
-
}
|
|
377
|
-
);
|
|
378
|
-
}, ue = (e) => {
|
|
379
|
-
if (R.current = null, p && U(z) && z.length) {
|
|
380
|
-
const t = e.split(new RegExp(`[${z.join("")}]`));
|
|
381
|
-
if (t.length > 1) {
|
|
382
|
-
R.current = Date.now();
|
|
383
|
-
const n = t.filter(
|
|
384
|
-
(i, f) => i && t.indexOf(i) === f
|
|
385
|
-
), r = o.slice(0);
|
|
386
|
-
let l = !1;
|
|
387
|
-
n.forEach((i) => {
|
|
388
|
-
r.indexOf(i) === -1 && (d || a.get(i)) && (r.push(i), l = !0);
|
|
389
|
-
}), l && I(r);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
return !!R.current;
|
|
393
|
-
}, pt = {
|
|
394
|
-
onFocus: tt,
|
|
395
|
-
onBlur: (e) => {
|
|
396
|
-
X == null || X(e), !O && !ae.current && A("", "optionListHide");
|
|
397
|
-
},
|
|
398
|
-
onKeyDown: (e) => {
|
|
399
|
-
if (e.target.tagName === "INPUT" && e.target.value) {
|
|
400
|
-
const t = e.key === $e.key, n = e.key === He.key;
|
|
401
|
-
if (n || t) {
|
|
402
|
-
const r = n ? `
|
|
403
|
-
` : t ? " " : "";
|
|
404
|
-
ue(e.target.value + r) && A("", "tokenSeparator");
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
K(e), ne == null || ne(e);
|
|
408
|
-
},
|
|
409
|
-
onChangeInputValue: (e, { nativeEvent: { inputType: t } }) => {
|
|
410
|
-
t !== "insertFromPaste" && ue(e), R.current ? A("", "tokenSeparator") : A(e, "manual"), !O && e && F(!0);
|
|
411
|
-
},
|
|
412
|
-
onPaste: (e) => {
|
|
413
|
-
ue(e.clipboardData.getData("text")), te == null || te(e);
|
|
414
|
-
},
|
|
415
|
-
// Option Items
|
|
416
|
-
onRemoveCheckedItem: (e, t, n) => {
|
|
417
|
-
n.stopPropagation(), Me(o[t], "remove");
|
|
418
|
-
},
|
|
419
|
-
onClear: (e) => {
|
|
420
|
-
if (e.stopPropagation(), p) {
|
|
421
|
-
const t = o.filter((n) => {
|
|
422
|
-
const r = a.get(n);
|
|
423
|
-
return r && r.disabled;
|
|
424
|
-
});
|
|
425
|
-
I(t);
|
|
426
|
-
} else
|
|
427
|
-
I(void 0);
|
|
428
|
-
A("", "manual"), J == null || J(O);
|
|
429
|
-
}
|
|
430
|
-
};
|
|
431
|
-
vt(
|
|
432
|
-
We,
|
|
433
|
-
() => {
|
|
434
|
-
var e;
|
|
435
|
-
return {
|
|
436
|
-
dom: (e = y.current) == null ? void 0 : e.dom,
|
|
437
|
-
focus() {
|
|
438
|
-
y.current && y.current.focus();
|
|
439
|
-
},
|
|
440
|
-
blur() {
|
|
441
|
-
y.current && y.current.blur();
|
|
442
|
-
},
|
|
443
|
-
hotkeyHandler: K,
|
|
444
|
-
activeOptionValue: C,
|
|
445
|
-
getOptionInfoByValue: L,
|
|
446
|
-
getOptionInfoList: () => [...a.values()].filter((t) => t._valid),
|
|
447
|
-
scrollIntoView: $,
|
|
448
|
-
getRootDOMNode() {
|
|
449
|
-
var t, n;
|
|
450
|
-
return (n = (t = y.current) == null ? void 0 : t.getRootDOMNode) == null ? void 0 : n.call(t);
|
|
451
|
-
}
|
|
452
|
-
};
|
|
453
|
-
},
|
|
454
|
-
[
|
|
455
|
-
K,
|
|
456
|
-
a,
|
|
457
|
-
C,
|
|
458
|
-
L,
|
|
459
|
-
$
|
|
460
|
-
]
|
|
461
|
-
);
|
|
462
|
-
const Le = (e) => /* @__PURE__ */ _(
|
|
463
|
-
wt,
|
|
464
|
-
{
|
|
465
|
-
ref: Ae,
|
|
466
|
-
popup: ct,
|
|
467
|
-
trigger: Ye,
|
|
468
|
-
disabled: Be,
|
|
469
|
-
getPopupContainer: Xe,
|
|
470
|
-
classNames: "slideDynamicOrigin",
|
|
471
|
-
autoAlignPopupWidth: !0,
|
|
472
|
-
popupAlign: $t,
|
|
473
|
-
popupVisible: O,
|
|
474
|
-
unmountOnExit: Je,
|
|
475
|
-
onVisibleChange: F,
|
|
476
|
-
__onExit: () => {
|
|
477
|
-
ae.current = !0;
|
|
478
|
-
},
|
|
479
|
-
__onExited: () => {
|
|
480
|
-
ae.current = !1, A("", "optionListHide");
|
|
481
|
-
},
|
|
482
|
-
...Et(c, ["popupVisible", "onVisibleChange"]),
|
|
483
|
-
children: e
|
|
484
|
-
}
|
|
485
|
-
), ce = typeof B == "function" ? B(j(o)) : B;
|
|
486
|
-
return V(() => {
|
|
487
|
-
var t;
|
|
488
|
-
const e = Ft([(t = y.current) == null ? void 0 : t.dom], () => {
|
|
489
|
-
var n, r;
|
|
490
|
-
(r = (n = Ae.current) == null ? void 0 : n.updatePopupPosition) == null || r.call(n);
|
|
491
|
-
});
|
|
492
|
-
return () => {
|
|
493
|
-
e();
|
|
494
|
-
};
|
|
495
|
-
}, [(Te = y.current) == null ? void 0 : Te.dom]), ce != null ? Le(ce) : /* @__PURE__ */ _(
|
|
496
|
-
xt,
|
|
497
|
-
{
|
|
498
|
-
...u,
|
|
499
|
-
...pt,
|
|
500
|
-
ref: y,
|
|
501
|
-
value: o,
|
|
502
|
-
inputValue: g,
|
|
503
|
-
popupVisible: O,
|
|
504
|
-
rtl: ge,
|
|
505
|
-
prefixCls: m,
|
|
506
|
-
allowCreate: !!d,
|
|
507
|
-
ariaControls: _e,
|
|
508
|
-
isEmptyValue: H,
|
|
509
|
-
isMultiple: p,
|
|
510
|
-
onSort: I,
|
|
511
|
-
renderText: (e) => {
|
|
512
|
-
const t = L(e);
|
|
513
|
-
let n = e;
|
|
514
|
-
if (Ot(he)) {
|
|
515
|
-
const r = j(e, !1);
|
|
516
|
-
n = he(
|
|
517
|
-
r.option || null,
|
|
518
|
-
r.value
|
|
519
|
-
);
|
|
520
|
-
} else {
|
|
521
|
-
let r = !1;
|
|
522
|
-
if (P) {
|
|
523
|
-
const l = u.value || u.defaultValue;
|
|
524
|
-
if (Array.isArray(l)) {
|
|
525
|
-
const i = l.find(
|
|
526
|
-
(f) => v(f) && f.value === e
|
|
527
|
-
);
|
|
528
|
-
i && (n = i.label, r = !0);
|
|
529
|
-
} else v(l) && (n = l.label, r = !0);
|
|
530
|
-
}
|
|
531
|
-
!r && t && "children" in t && (n = t.children);
|
|
532
|
-
}
|
|
533
|
-
return {
|
|
534
|
-
text: n,
|
|
535
|
-
disabled: t && t.disabled
|
|
536
|
-
};
|
|
537
|
-
},
|
|
538
|
-
renderView: Le
|
|
539
|
-
}
|
|
540
|
-
);
|
|
541
|
-
}
|
|
542
|
-
const jt = ht.forwardRef(Gt), me = jt;
|
|
543
|
-
me.displayName = "Select";
|
|
544
|
-
me.Option = Tt;
|
|
545
|
-
me.OptGroup = Lt;
|
|
22
|
+
import "lodash/isPlainObject.js";
|
|
546
23
|
export {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
24
|
+
j as SelectOption,
|
|
25
|
+
v as SelectOptionGroup,
|
|
26
|
+
k as default
|
|
550
27
|
};
|
package/select/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { S as o } from "../chunk/Cwm8LL5p.js";
|
|
2
|
+
import { O as r } from "../chunk/Cwm8LL5p.js";
|
|
3
3
|
import { default as f } from "./OptGroup.js";
|
|
4
4
|
export {
|
|
5
5
|
r as SelectOption,
|
|
6
6
|
f as SelectOptionGroup,
|
|
7
|
-
|
|
7
|
+
o as default
|
|
8
8
|
};
|