@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/tree-select/List.js
CHANGED
|
@@ -1,124 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
function O(r, S) {
|
|
7
|
-
const {
|
|
8
|
-
value: c,
|
|
9
|
-
multiple: d,
|
|
10
|
-
loadMore: k,
|
|
11
|
-
treeCheckedStrategy: _,
|
|
12
|
-
treeCheckStrictly: w,
|
|
13
|
-
treeData: M,
|
|
14
|
-
treeProps: b,
|
|
15
|
-
prefixCls: m,
|
|
16
|
-
treeCheckable: R
|
|
17
|
-
} = r, C = b && b.renderTitle, h = $(), p = u(
|
|
18
|
-
(t, { checkedNodes: e, checked: a, node: l }) => {
|
|
19
|
-
const i = t.map((n) => {
|
|
20
|
-
const o = e.find((s) => s && s.props._key === n);
|
|
21
|
-
return o ? {
|
|
22
|
-
label: o.props.title,
|
|
23
|
-
value: o.props._key,
|
|
24
|
-
disabled: o.props.disabled
|
|
25
|
-
} : c.find((f) => f.value === n) || {
|
|
26
|
-
label: n,
|
|
27
|
-
value: n
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
|
-
r.onChange(i, {
|
|
31
|
-
checked: a,
|
|
32
|
-
trigger: l == null ? void 0 : l.props
|
|
33
|
-
});
|
|
34
|
-
},
|
|
35
|
-
[r.onChange, c]
|
|
36
|
-
), g = u(
|
|
37
|
-
(t, { node: e, selected: a }) => {
|
|
38
|
-
let l = [
|
|
39
|
-
{
|
|
40
|
-
value: e.props._key,
|
|
41
|
-
label: e.props.title
|
|
42
|
-
}
|
|
43
|
-
];
|
|
44
|
-
if (d) {
|
|
45
|
-
l = [...c];
|
|
46
|
-
const i = l.findIndex((n) => n.value === e.props._key);
|
|
47
|
-
i > -1 ? l.splice(i, 1) : l.push({
|
|
48
|
-
value: e.props._key,
|
|
49
|
-
label: e.props.title
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
r.onChange(l, { trigger: e == null ? void 0 : e.props, selected: a });
|
|
53
|
-
},
|
|
54
|
-
[r.onChange, c, d]
|
|
55
|
-
), v = u((t, { node: e, e: a }) => {
|
|
56
|
-
var s, f;
|
|
57
|
-
const { checked: l, checkable: i, disabled: n, disableCheckbox: o } = e.props;
|
|
58
|
-
h.current && !o && !n && i !== !1 && ((f = (s = h.current) == null ? void 0 : s.handleCheck) == null || f.call(s, !l, e.props._key, a));
|
|
59
|
-
}, []), L = u(
|
|
60
|
-
(t) => {
|
|
61
|
-
if (z(k)) {
|
|
62
|
-
const e = t.props.dataRef;
|
|
63
|
-
return k(t, e);
|
|
64
|
-
}
|
|
65
|
-
return [];
|
|
66
|
-
},
|
|
67
|
-
[k]
|
|
68
|
-
), N = u(
|
|
69
|
-
(t) => {
|
|
70
|
-
if (C)
|
|
71
|
-
return C(t);
|
|
72
|
-
const e = r.inputValue, { title: a } = t;
|
|
73
|
-
if (e && I(a)) {
|
|
74
|
-
const l = a.toLowerCase().indexOf(e.toLowerCase());
|
|
75
|
-
if (l === -1)
|
|
76
|
-
return a;
|
|
77
|
-
const i = a.substring(0, l + 1), n = a.substring(l + e.length);
|
|
78
|
-
return /* @__PURE__ */ j("span", { children: [
|
|
79
|
-
i,
|
|
80
|
-
/* @__PURE__ */ x("span", { className: `${m}-highlight`, children: a.substring(l, e.length + 1) }),
|
|
81
|
-
n
|
|
82
|
-
] });
|
|
83
|
-
}
|
|
84
|
-
return a;
|
|
85
|
-
},
|
|
86
|
-
[m, r.inputValue, C]
|
|
87
|
-
), V = y(() => r.treeCheckable ? {
|
|
88
|
-
onCheck: p,
|
|
89
|
-
checkedKeys: c.map((t) => t.value)
|
|
90
|
-
} : {}, [p, c, r.treeCheckable]), T = y(() => r.treeCheckable ? [] : c.map((t) => t.value), [r.treeCheckable, c]), D = u(
|
|
91
|
-
(t, e) => {
|
|
92
|
-
r.treeCheckable ? v(t, e) : g(t, e);
|
|
93
|
-
},
|
|
94
|
-
[r.treeCheckable, v, g]
|
|
95
|
-
);
|
|
96
|
-
return F(S, () => h.current, []), /* @__PURE__ */ x(
|
|
97
|
-
H,
|
|
98
|
-
{
|
|
99
|
-
ref: h,
|
|
100
|
-
size: r.size,
|
|
101
|
-
blockNode: !0,
|
|
102
|
-
filterNode: r.filterNode,
|
|
103
|
-
...b,
|
|
104
|
-
checkable: R,
|
|
105
|
-
multiple: d,
|
|
106
|
-
loadMore: r.loadMore ? L : void 0,
|
|
107
|
-
checkedStrategy: _,
|
|
108
|
-
checkStrictly: w,
|
|
109
|
-
onMouseDown: (t) => {
|
|
110
|
-
t.preventDefault();
|
|
111
|
-
},
|
|
112
|
-
...V,
|
|
113
|
-
treeData: M,
|
|
114
|
-
fieldNames: r.fieldNames,
|
|
115
|
-
renderTitle: N,
|
|
116
|
-
onSelect: D,
|
|
117
|
-
selectedKeys: T
|
|
118
|
-
}
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
const G = K(O);
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "lodash/isFunction";
|
|
3
|
+
import "lodash/isString";
|
|
4
|
+
import "react";
|
|
5
|
+
import { aa as i } from "../chunk/Cwm8LL5p.js";
|
|
122
6
|
export {
|
|
123
|
-
|
|
7
|
+
i as default
|
|
124
8
|
};
|
package/tree-select/Select.js
CHANGED
|
@@ -1,395 +1,25 @@
|
|
|
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
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
1
|
+
import "react/jsx-runtime";
|
|
2
|
+
import "../chunk/C0pRaDCf.js";
|
|
3
|
+
import "lodash/debounce";
|
|
4
|
+
import "lodash/isArray";
|
|
5
|
+
import "lodash/isFunction";
|
|
6
|
+
import "lodash/isNil";
|
|
7
|
+
import "react";
|
|
8
|
+
import "../chunk/CNcLypMY.js";
|
|
9
|
+
import "../chunk/B4YRLi8r.js";
|
|
10
|
+
import "../chunk/oopARUrq.js";
|
|
11
|
+
import "../chunk/BFTV6myl.js";
|
|
12
|
+
import "../chunk/DeV0v__J.js";
|
|
13
|
+
import "../select-view/index.js";
|
|
14
|
+
import { v as j, t as k } from "../chunk/Cwm8LL5p.js";
|
|
15
|
+
import "../tree/util.js";
|
|
16
|
+
import "../trigger/index.js";
|
|
17
|
+
import "../chunk/CUFsOxJ2.js";
|
|
18
18
|
import "../chunk/DAAff-FT.js";
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import { u as G } from "../chunk/a3hR6zLw.js";
|
|
23
|
-
import { DefaultFieldNames as ue } from "./interface.js";
|
|
24
|
-
import le from "lodash/isEqualWith";
|
|
25
|
-
import Ne from "lodash/isPlainObject";
|
|
26
|
-
import Ee from "lodash/isUndefined";
|
|
27
|
-
import { normalizeValueToArray as W } from "./util.js";
|
|
28
|
-
import { u as Fe } from "../chunk/VSe_Wq1g.js";
|
|
29
|
-
import oe from "lodash/isPlainObject.js";
|
|
30
|
-
const ie = (r, u, o) => {
|
|
31
|
-
const a = {};
|
|
32
|
-
let f = 0;
|
|
33
|
-
const i = (e, c) => {
|
|
34
|
-
const p = e.length;
|
|
35
|
-
return e.map((n, y) => {
|
|
36
|
-
const g = v(n, o.children) || n[o.children], m = v(n, o.key) || n[o.key] || `${(c == null ? void 0 : c._key) || ""}-${y}`, s = {
|
|
37
|
-
...n,
|
|
38
|
-
title: v(n, o.title) || n[o.title],
|
|
39
|
-
selectable: v(n, o.selectable) || n[o.selectable],
|
|
40
|
-
disabled: v(n, o.disabled) || n[o.disabled],
|
|
41
|
-
disableCheckbox: v(n, o.disableCheckbox) || n[o.disableCheckbox],
|
|
42
|
-
checkable: v(n, o.checkable) || n[o.checkable],
|
|
43
|
-
isLeaf: v(n, o.isLeaf) || n[o.isLeaf],
|
|
44
|
-
key: m,
|
|
45
|
-
children: g,
|
|
46
|
-
_key: m,
|
|
47
|
-
parentKey: c ? c._key : void 0,
|
|
48
|
-
pathParentKeys: c && c.pathParentKeys || [],
|
|
49
|
-
_level: c._level || 0,
|
|
50
|
-
_index: f++
|
|
51
|
-
};
|
|
52
|
-
return p === y + 1 && (s.className = z(
|
|
53
|
-
`${u}-node-is-tail`,
|
|
54
|
-
s.className
|
|
55
|
-
)), a[m] = s, g && g.length && (a[m].children = i(g, {
|
|
56
|
-
_key: m,
|
|
57
|
-
_level: s._level + 1,
|
|
58
|
-
pathParentKeys: [...(c == null ? void 0 : c.pathParentKeys) || [], m]
|
|
59
|
-
})), s;
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
return i(r || [], {}), a;
|
|
63
|
-
}, We = (r, u) => {
|
|
64
|
-
const { getPrefixCls: o } = ce(se), a = {
|
|
65
|
-
...ue,
|
|
66
|
-
...u
|
|
67
|
-
}, f = Le(), i = o("tree"), e = P(
|
|
68
|
-
ie(r, i, a)
|
|
69
|
-
);
|
|
70
|
-
return G(() => {
|
|
71
|
-
e.current = ie(r, i, a), f();
|
|
72
|
-
}, [r]), e.current;
|
|
73
|
-
}, x = (r, u, o) => r == null ? [] : (q(r) ? r : [r]).map((f) => {
|
|
74
|
-
let i = Ne(f) ? { ...f } : { value: f, label: void 0 };
|
|
75
|
-
const e = u[i.value];
|
|
76
|
-
if (e)
|
|
77
|
-
i.label = i.label || e.title, i.disabled = e.disabled;
|
|
78
|
-
else if (q(o)) {
|
|
79
|
-
const c = o.find((p) => p.value === i.value);
|
|
80
|
-
i = {
|
|
81
|
-
...i,
|
|
82
|
-
...c
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
return Ee(i.label) && (i.label = i.value), i;
|
|
86
|
-
}), xe = (r, u, o, a) => {
|
|
87
|
-
if (!a.treeCheckStrictly) {
|
|
88
|
-
const { checkedKeys: f, indeterminateKeys: i } = _e(r, u);
|
|
89
|
-
let e = f;
|
|
90
|
-
return o.current = i, a.treeCheckedStrategy === V.SHOW_PARENT ? e = e.filter((c) => {
|
|
91
|
-
const p = u[c];
|
|
92
|
-
if (!p || e.indexOf(p.parentKey) === -1)
|
|
93
|
-
return !0;
|
|
94
|
-
}) : a.treeCheckedStrategy === V.SHOW_CHILD && (e = e.filter((c) => {
|
|
95
|
-
const p = u[c];
|
|
96
|
-
if (!p || !p.children || !p.children.length)
|
|
97
|
-
return !0;
|
|
98
|
-
})), e;
|
|
99
|
-
}
|
|
100
|
-
return o.current = [], r;
|
|
101
|
-
}, Ae = (r, u, o) => {
|
|
102
|
-
const a = P([]), f = () => {
|
|
103
|
-
const n = r.value || r.defaultValue || [];
|
|
104
|
-
if (r.treeCheckable) {
|
|
105
|
-
const y = xe(
|
|
106
|
-
W(n),
|
|
107
|
-
u,
|
|
108
|
-
o,
|
|
109
|
-
r
|
|
110
|
-
), g = x(
|
|
111
|
-
n,
|
|
112
|
-
u,
|
|
113
|
-
a.current
|
|
114
|
-
);
|
|
115
|
-
return x(
|
|
116
|
-
y,
|
|
117
|
-
u,
|
|
118
|
-
g
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
return x(n, u);
|
|
122
|
-
}, [i, e] = J(f), c = (n) => {
|
|
123
|
-
a.current = n, e(n);
|
|
124
|
-
};
|
|
125
|
-
G(() => {
|
|
126
|
-
const n = f();
|
|
127
|
-
"value" in r && (r.labelInValue ? le(
|
|
128
|
-
W(i),
|
|
129
|
-
W(n)
|
|
130
|
-
) || c(n) : le(i, n) || c(n));
|
|
131
|
-
}, [
|
|
132
|
-
r.treeCheckedStrategy,
|
|
133
|
-
r.treeCheckStrictly,
|
|
134
|
-
r.treeCheckable,
|
|
135
|
-
r.value,
|
|
136
|
-
u
|
|
137
|
-
]);
|
|
138
|
-
const p = T(
|
|
139
|
-
(n, y) => {
|
|
140
|
-
const { onChange: g, labelInValue: m } = r, s = r.multiple || r.treeCheckable;
|
|
141
|
-
"value" in r || c(n);
|
|
142
|
-
let I;
|
|
143
|
-
s ? I = n.map((_) => m ? { label: _.label, value: _.value } : _.value) : I = m ? n[0] : n[0] && n[0].value, g == null || g(I, y);
|
|
144
|
-
},
|
|
145
|
-
[
|
|
146
|
-
r.onChange,
|
|
147
|
-
r.labelInValue,
|
|
148
|
-
r.multiple,
|
|
149
|
-
r.treeCheckable,
|
|
150
|
-
r.value
|
|
151
|
-
]
|
|
152
|
-
);
|
|
153
|
-
return [i, p];
|
|
154
|
-
};
|
|
155
|
-
function $e(r) {
|
|
156
|
-
const u = Fe(r) || {}, o = () => r.treeData || He(r.children), [a, f] = J(o());
|
|
157
|
-
return G(() => {
|
|
158
|
-
(r.treeData !== u.treeData || r.children !== u.children) && f(o());
|
|
159
|
-
}, [r]), [a];
|
|
160
|
-
}
|
|
161
|
-
const Me = {
|
|
162
|
-
bordered: !0,
|
|
163
|
-
treeCheckedStrategy: V.SHOW_CHILD,
|
|
164
|
-
fieldNames: ue
|
|
165
|
-
}, Ue = { bottom: 4 }, je = (r, u) => {
|
|
166
|
-
const { getPrefixCls: o, renderEmpty: a, componentConfig: f, rtl: i } = ce(se), e = Oe(
|
|
167
|
-
r,
|
|
168
|
-
Me,
|
|
169
|
-
f == null ? void 0 : f.TreeSelect
|
|
170
|
-
), c = Ke(), p = P(), n = P(null), y = P(null), g = P([]), [m] = $e(e), s = We(m, e.fieldNames), [I, _] = J(), [K, ae] = ne(!1, {
|
|
171
|
-
value: e.popupVisible
|
|
172
|
-
}), [b, fe] = ne(
|
|
173
|
-
void 0,
|
|
174
|
-
// Compatible with previous behavior 'undefined as default'
|
|
175
|
-
{
|
|
176
|
-
value: "inputValue" in e ? e.inputValue || "" : void 0
|
|
177
|
-
}
|
|
178
|
-
), L = P(b), Q = P(null), { onInputValueChange: A } = e, [C, $] = Ae(
|
|
179
|
-
e,
|
|
180
|
-
s,
|
|
181
|
-
g
|
|
182
|
-
), H = e.multiple || e.treeCheckable, O = o("tree-select"), M = b && !R(e.onSearch), X = Ie(`${O}-popup-`), Y = (t) => {
|
|
183
|
-
var l;
|
|
184
|
-
t !== K && (ae(t), (l = e.onVisibleChange) == null || l.call(e, t));
|
|
185
|
-
}, U = (t, l) => {
|
|
186
|
-
(t !== L.current || l !== Q.current) && (fe(t), L.current = t, Q.current = l, A == null || A(t, l));
|
|
187
|
-
}, de = T(
|
|
188
|
-
(t) => ke(async (d) => {
|
|
189
|
-
if (R(e.onSearch)) {
|
|
190
|
-
await e.onSearch(d);
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
if (!d)
|
|
194
|
-
return m;
|
|
195
|
-
const h = /* @__PURE__ */ new Set();
|
|
196
|
-
Object.keys(s).forEach((k) => {
|
|
197
|
-
const S = s[k];
|
|
198
|
-
let E = !1;
|
|
199
|
-
if (R(e.filterTreeNode))
|
|
200
|
-
e.filterTreeNode(d, /* @__PURE__ */ D(V.Node, { ...S })) && (E = !0);
|
|
201
|
-
else {
|
|
202
|
-
const F = S.value || S._key;
|
|
203
|
-
F && F.indexOf(d) > -1 && (E = !0);
|
|
204
|
-
}
|
|
205
|
-
E && h.add(S.key);
|
|
206
|
-
}), _(h);
|
|
207
|
-
}, 100)(t),
|
|
208
|
-
[e.onSearch, m, s, e.filterTreeNode]
|
|
209
|
-
), Z = T(() => {
|
|
210
|
-
let t = !0;
|
|
211
|
-
oe(e.showSearch) && (t = e.showSearch.retainInputValueWhileSelect !== !1), e.multiple && !t && b !== void 0 && U("", "optionChecked");
|
|
212
|
-
}, [b, e.multiple, JSON.stringify(e.showSearch)]), N = T(
|
|
213
|
-
(t, l) => {
|
|
214
|
-
$(t, l), Z(), H || Y(!1);
|
|
215
|
-
},
|
|
216
|
-
[$, Z, K]
|
|
217
|
-
), me = (t, l, d) => {
|
|
218
|
-
if (d.stopPropagation(), t.disabled)
|
|
219
|
-
return;
|
|
220
|
-
const h = oe(t.value) ? t.value.value : t.value;
|
|
221
|
-
if (!e.treeCheckable || e.treeCheckStrictly || !s[h]) {
|
|
222
|
-
const S = C.filter((E, F) => F !== l);
|
|
223
|
-
N(S, {
|
|
224
|
-
trigger: s[h] || t,
|
|
225
|
-
checked: !1,
|
|
226
|
-
selected: !1
|
|
227
|
-
});
|
|
228
|
-
return;
|
|
229
|
-
}
|
|
230
|
-
const k = De(
|
|
231
|
-
h,
|
|
232
|
-
!1,
|
|
233
|
-
W(C),
|
|
234
|
-
s,
|
|
235
|
-
g.current
|
|
236
|
-
);
|
|
237
|
-
g.current = k.indeterminateKeys, N(x(k.checkedKeys, s, C), {
|
|
238
|
-
trigger: s[h],
|
|
239
|
-
checked: !1,
|
|
240
|
-
selected: !1
|
|
241
|
-
});
|
|
242
|
-
};
|
|
243
|
-
function j(t) {
|
|
244
|
-
return be(t) || ye(t) || Ce(t);
|
|
245
|
-
}
|
|
246
|
-
re(() => {
|
|
247
|
-
b !== void 0 && de(b), b !== L.current && (L.current = b);
|
|
248
|
-
}, [b]);
|
|
249
|
-
const B = ve(() => {
|
|
250
|
-
let t = [];
|
|
251
|
-
if (b)
|
|
252
|
-
for (const l in s) {
|
|
253
|
-
const h = [...s[l].pathParentKeys, l];
|
|
254
|
-
h.some((k) => I && I.has(k)) && (t = t.concat(h));
|
|
255
|
-
}
|
|
256
|
-
return Array.from(new Set(t));
|
|
257
|
-
}, [b, s, I]);
|
|
258
|
-
re(() => {
|
|
259
|
-
K ? setTimeout(() => {
|
|
260
|
-
const t = C[0];
|
|
261
|
-
n.current && t && n.current.scrollIntoView(t.value);
|
|
262
|
-
}) : c || b && U("", "optionListHide");
|
|
263
|
-
}, [K]), Pe(u, () => ({
|
|
264
|
-
focus() {
|
|
265
|
-
y.current && y.current.focus();
|
|
266
|
-
},
|
|
267
|
-
blur() {
|
|
268
|
-
y.current && y.current.blur();
|
|
269
|
-
},
|
|
270
|
-
getRootDOMNode: () => {
|
|
271
|
-
var t, l;
|
|
272
|
-
return (l = (t = y.current) == null ? void 0 : t.getRootDOMNode) == null ? void 0 : l.call(t);
|
|
273
|
-
}
|
|
274
|
-
}));
|
|
275
|
-
const he = T(
|
|
276
|
-
(t) => M ? B.indexOf(t._key) > -1 : !0,
|
|
277
|
-
[M, B]
|
|
278
|
-
), pe = T(
|
|
279
|
-
(t) => {
|
|
280
|
-
const { disabled: l, value: d } = t || {};
|
|
281
|
-
let h = t == null ? void 0 : t.label;
|
|
282
|
-
return R(e.renderFormat) && (h = e.renderFormat(
|
|
283
|
-
s[d] || null,
|
|
284
|
-
e.labelInValue ? t : d
|
|
285
|
-
)), { text: h || d || "", disabled: l };
|
|
286
|
-
},
|
|
287
|
-
[e.renderFormat, e.labelInValue, s]
|
|
288
|
-
), ge = (t) => {
|
|
289
|
-
$(t, {});
|
|
290
|
-
}, ee = (t) => /* @__PURE__ */ D(
|
|
291
|
-
Re,
|
|
292
|
-
{
|
|
293
|
-
autoAlignPopupWidth: !1,
|
|
294
|
-
autoAlignPopupMinWidth: !0,
|
|
295
|
-
ref: p,
|
|
296
|
-
classNames: "slideDynamicOrigin",
|
|
297
|
-
trigger: "click",
|
|
298
|
-
position: "bl",
|
|
299
|
-
getPopupContainer: e.getPopupContainer,
|
|
300
|
-
popupAlign: Ue,
|
|
301
|
-
unmountOnExit: e.unmountOnExit,
|
|
302
|
-
...e.triggerProps,
|
|
303
|
-
className: z(
|
|
304
|
-
`${O}-trigger`,
|
|
305
|
-
e.triggerProps && e.triggerProps.className
|
|
306
|
-
),
|
|
307
|
-
popup: () => {
|
|
308
|
-
var h, k, S;
|
|
309
|
-
const l = e.dropdownRender, d = M && j(B) || j(m) ? e.notFoundContent || (a == null ? void 0 : a("TreeSelect")) : /* @__PURE__ */ D(
|
|
310
|
-
we,
|
|
311
|
-
{
|
|
312
|
-
prefixCls: O,
|
|
313
|
-
ref: n,
|
|
314
|
-
...e,
|
|
315
|
-
inputValue: b,
|
|
316
|
-
filterNode: he,
|
|
317
|
-
value: C,
|
|
318
|
-
onChange: N,
|
|
319
|
-
multiple: H,
|
|
320
|
-
treeData: m
|
|
321
|
-
}
|
|
322
|
-
);
|
|
323
|
-
return /* @__PURE__ */ D(
|
|
324
|
-
"div",
|
|
325
|
-
{
|
|
326
|
-
id: X,
|
|
327
|
-
className: z(`${O}-popup`, {
|
|
328
|
-
[`${O}-rtl-popup`]: i
|
|
329
|
-
}),
|
|
330
|
-
style: {
|
|
331
|
-
maxHeight: (h = e.treeProps) != null && h.height || (S = (k = e.treeProps) == null ? void 0 : k.virtualListProps) != null && S.height ? "unset" : "",
|
|
332
|
-
...e.dropdownMenuStyle
|
|
333
|
-
},
|
|
334
|
-
children: R(l) ? l(d) : d
|
|
335
|
-
}
|
|
336
|
-
);
|
|
337
|
-
},
|
|
338
|
-
disabled: e.disabled,
|
|
339
|
-
onVisibleChange: (l) => {
|
|
340
|
-
Y(l);
|
|
341
|
-
},
|
|
342
|
-
popupVisible: K,
|
|
343
|
-
children: t
|
|
344
|
-
}
|
|
345
|
-
), te = typeof e.triggerElement == "function" ? (() => {
|
|
346
|
-
var l;
|
|
347
|
-
let t;
|
|
348
|
-
return H ? t = C.map(
|
|
349
|
-
(d) => e.labelInValue ? { label: d.label, value: d.value } : d.value
|
|
350
|
-
) : t = e.labelInValue ? C[0] : (l = C[0]) == null ? void 0 : l.value, e.triggerElement({ value: t });
|
|
351
|
-
})() : e.triggerElement;
|
|
352
|
-
return Se(te) ? /* @__PURE__ */ D(
|
|
353
|
-
Te,
|
|
354
|
-
{
|
|
355
|
-
ref: y,
|
|
356
|
-
rtl: i,
|
|
357
|
-
ariaControls: X,
|
|
358
|
-
...e,
|
|
359
|
-
popupVisible: K,
|
|
360
|
-
value: !H && q(C) ? C[0] : C,
|
|
361
|
-
inputValue: b,
|
|
362
|
-
isEmptyValue: j(C),
|
|
363
|
-
prefixCls: O,
|
|
364
|
-
isMultiple: H,
|
|
365
|
-
renderText: pe,
|
|
366
|
-
onSort: ge,
|
|
367
|
-
onRemoveCheckedItem: me,
|
|
368
|
-
onClear: (t) => {
|
|
369
|
-
var l;
|
|
370
|
-
t.stopPropagation(), N([], {}), (l = e.onClear) == null || l.call(e, !!K);
|
|
371
|
-
},
|
|
372
|
-
onKeyDown: (t) => {
|
|
373
|
-
var l;
|
|
374
|
-
t.stopPropagation(), (l = e.onKeyDown) == null || l.call(e, t);
|
|
375
|
-
},
|
|
376
|
-
onFocus: (t) => {
|
|
377
|
-
t && t.stopPropagation();
|
|
378
|
-
},
|
|
379
|
-
onChangeInputValue: (t) => {
|
|
380
|
-
U(t, "manual");
|
|
381
|
-
},
|
|
382
|
-
renderView: ee
|
|
383
|
-
}
|
|
384
|
-
) : ee(te);
|
|
385
|
-
}, Be = Ve(je), w = Be;
|
|
386
|
-
w.displayName = "TreeSelect";
|
|
387
|
-
w.Node = V.Node;
|
|
388
|
-
w.SHOW_ALL = V.SHOW_ALL;
|
|
389
|
-
w.SHOW_PARENT = V.SHOW_PARENT;
|
|
390
|
-
w.SHOW_CHILD = V.SHOW_CHILD;
|
|
391
|
-
const St = V.Node;
|
|
19
|
+
import "./interface.js";
|
|
20
|
+
import "./util.js";
|
|
21
|
+
import "lodash/isPlainObject.js";
|
|
392
22
|
export {
|
|
393
|
-
|
|
394
|
-
|
|
23
|
+
j as TreeSelectTreeNode,
|
|
24
|
+
k as default
|
|
395
25
|
};
|
package/tree-select/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import o from "
|
|
2
|
-
import {
|
|
1
|
+
import { t as o } from "../chunk/Cwm8LL5p.js";
|
|
2
|
+
import { v as a } from "../chunk/Cwm8LL5p.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
4
|
+
a as TreeSelectTreeNode,
|
|
5
5
|
o as default
|
|
6
6
|
};
|
package/trigger/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import ct from "lodash/isArray";
|
|
|
4
4
|
import M from "lodash/isFunction";
|
|
5
5
|
import { forwardRef as lt, useContext as pt, useRef as R, useState as at, Children as He, useCallback as be, cloneElement as Ie, useImperativeHandle as ft, useLayoutEffect as dt, useEffect as g, Fragment as mt } from "react";
|
|
6
6
|
import { createPortal as gt } from "react-dom";
|
|
7
|
-
import { a as yt } from "../chunk/
|
|
7
|
+
import { a as yt } from "../chunk/CNcLypMY.js";
|
|
8
8
|
import { p as te } from "../chunk/CUFsOxJ2.js";
|
|
9
9
|
import { on as oe, off as ne, getScrollElements as Tt, isScrollElement as Ct, contains as Le } from "../utils/dom.js";
|
|
10
10
|
import { s as ht } from "../chunk/DAAff-FT.js";
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import CheckboxGroup from './Group';
|
|
3
|
+
import CheckboxGroupBlock from './GroupBlock';
|
|
3
4
|
import type { CheckboxProps } from './interface';
|
|
4
5
|
import useCheckbox from './useCheckbox';
|
|
5
6
|
interface ForwardRefCheckboxType extends React.ForwardRefExoticComponent<React.PropsWithoutRef<CheckboxProps> & React.RefAttributes<unknown>> {
|
|
6
7
|
<T extends React.ReactText = any>(props: React.PropsWithChildren<CheckboxProps<T>> & {
|
|
7
8
|
ref?: React.Ref<unknown>;
|
|
8
9
|
}): React.ReactElement;
|
|
9
|
-
Group: typeof
|
|
10
|
+
Group: typeof CheckboxGroup;
|
|
11
|
+
GroupBlock: typeof CheckboxGroupBlock;
|
|
10
12
|
useCheckbox: typeof useCheckbox;
|
|
11
13
|
}
|
|
12
14
|
declare const CheckboxComponent: ForwardRefCheckboxType;
|
|
15
|
+
export { CheckboxGroup, CheckboxGroupBlock, useCheckbox };
|
|
13
16
|
export default CheckboxComponent;
|
|
14
17
|
export type { CheckboxProps };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CheckboxGroupProps } from './interface';
|
|
2
|
+
declare function CheckboxGroupBlock(props: any): import("react/jsx-dev-runtime").JSX.Element;
|
|
3
|
+
declare namespace CheckboxGroupBlock {
|
|
4
|
+
var displayName: string;
|
|
5
|
+
}
|
|
6
|
+
export default CheckboxGroupBlock;
|
|
7
|
+
export type { CheckboxGroupProps };
|
|
@@ -1,32 +1,5 @@
|
|
|
1
1
|
import ConfigContext from './context';
|
|
2
2
|
import type { ConfigProviderProps } from './interface';
|
|
3
|
-
export declare const colors: {
|
|
4
|
-
primaryColor: {
|
|
5
|
-
default: string;
|
|
6
|
-
hover: string;
|
|
7
|
-
active: string;
|
|
8
|
-
};
|
|
9
|
-
successColor: {
|
|
10
|
-
default: string;
|
|
11
|
-
hover: string;
|
|
12
|
-
active: string;
|
|
13
|
-
};
|
|
14
|
-
infoColor: {
|
|
15
|
-
default: string;
|
|
16
|
-
hover: string;
|
|
17
|
-
active: string;
|
|
18
|
-
};
|
|
19
|
-
warningColor: {
|
|
20
|
-
default: string;
|
|
21
|
-
hover: string;
|
|
22
|
-
active: string;
|
|
23
|
-
};
|
|
24
|
-
dangerColor: {
|
|
25
|
-
default: string;
|
|
26
|
-
hover: string;
|
|
27
|
-
active: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
3
|
declare function ConfigProvider(baseProps: ConfigProviderProps): import("react/jsx-dev-runtime").JSX.Element;
|
|
31
4
|
declare namespace ConfigProvider {
|
|
32
5
|
var ConfigContext: import("react").Context<ConfigProviderProps>;
|
|
@@ -148,7 +148,6 @@ export type ComponentConfig = {
|
|
|
148
148
|
Upload?: UploadProps;
|
|
149
149
|
};
|
|
150
150
|
export interface ConfigProviderProps {
|
|
151
|
-
toAuthor: false;
|
|
152
151
|
autoInsertSpaceInButton?: boolean;
|
|
153
152
|
componentConfig?: ComponentConfig;
|
|
154
153
|
locale?: Locale;
|
|
@@ -163,6 +162,9 @@ export interface ConfigProviderProps {
|
|
|
163
162
|
rtl?: boolean;
|
|
164
163
|
effectGlobalNotice?: boolean;
|
|
165
164
|
effectGlobalModal?: boolean;
|
|
165
|
+
keepConfig?: boolean;
|
|
166
|
+
isRootConfig?: boolean;
|
|
167
|
+
childrenName?: string;
|
|
166
168
|
zIndex?: number;
|
|
167
169
|
children?: ReactNode;
|
|
168
170
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { default as Calendar } from './calendar';
|
|
|
13
13
|
export { default as Card } from './card';
|
|
14
14
|
export { default as Carousel } from './carousel';
|
|
15
15
|
export { default as Cascader } from './cascader';
|
|
16
|
-
export { default as Checkbox } from './checkbox';
|
|
16
|
+
export { default as Checkbox, CheckboxGroup, CheckboxGroupBlock, } from './checkbox';
|
|
17
17
|
export { default as Collapse } from './collapse';
|
|
18
18
|
export { default as Comment } from './comment';
|
|
19
19
|
export { ConfigConsumer, ConfigContext, default as ConfigProvider, } from './config-provider';
|
|
@@ -91,7 +91,7 @@ export type { PaginationProps } from './pagination/interface';
|
|
|
91
91
|
export type { PopconfirmProps } from './popconfirm/interface';
|
|
92
92
|
export type { PopoverProps } from './popover/interface';
|
|
93
93
|
export type { ProgressProps } from './progress/interface';
|
|
94
|
-
export { default as Radio, RadioGroup, RadioGroupContext } from './radio';
|
|
94
|
+
export { default as Radio, RadioGroup, RadioGroupBlock, RadioGroupContext, } from './radio';
|
|
95
95
|
export type { RadioGroupProps, RadioProps } from './radio/interface';
|
|
96
96
|
export { default as Rate } from './rate';
|
|
97
97
|
export type { RateProps } from './rate/interface';
|
package/types/menu/context.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type HotkeyInfo = {
|
|
|
5
5
|
type: 'sibling' | 'generation' | 'enter';
|
|
6
6
|
};
|
|
7
7
|
export type ResetHotkeyInfo = (activeKey?: string) => void;
|
|
8
|
-
declare const MenuContext: import("react").Context<Pick<MenuProps, "mode" | "collapse" | "icons" | "triggerProps" | "inDropdown" | "
|
|
8
|
+
declare const MenuContext: import("react").Context<Pick<MenuProps, "mode" | "collapse" | "icons" | "triggerProps" | "inDropdown" | "tooltipProps" | "theme" | "levelIndent" | "selectedKeys" | "openKeys" | "autoScrollIntoView" | "scrollConfig"> & {
|
|
9
9
|
id?: string;
|
|
10
10
|
prefixCls?: string;
|
|
11
11
|
onClickMenuItem?: (key: string, e: any) => void;
|