@unicom-cloud/ui 0.8.92 → 0.8.94
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/Checkbox.js +5 -4
- package/Layout.js +8 -7
- package/cascader/panel/Option.js +7 -6
- package/cascader/panel/Search.js +17 -16
- package/checkbox/index.js +7 -6
- package/color-picker/Mode.js +7 -6
- package/index.js +171 -171
- package/layout/index.js +11 -9
- package/package.json +1 -1
- package/pagination/PageItem.js +52 -53
- package/pagination/Pagination.js +2 -1
- package/pagination/interface.js +4 -1
- package/select/Option.js +12 -11
- package/select/Select.js +1 -0
- package/table/tbody/Tr.js +3 -2
- package/table/thead/Column.js +3 -2
- package/table/thead/index.js +3 -2
- package/transfer/Item.js +17 -16
- package/transfer/List.js +12 -11
- package/tree/Node.js +94 -92
- package/tree/Tree.js +182 -182
- package/types/pc/affix/index.d.ts +1 -1
- package/types/pc/alert/index.d.ts +1 -1
- package/types/pc/anchor/Anchor.d.ts +1 -1
- package/types/pc/anchor/Link.d.ts +1 -1
- package/types/pc/anchor/context.d.ts +1 -1
- package/types/pc/auto-complete/index.d.ts +1 -1
- package/types/pc/avatar/Avatar.d.ts +1 -1
- package/types/pc/avatar/Group.d.ts +1 -1
- package/types/pc/avatar/context.d.ts +1 -1
- package/types/pc/back-top/index.d.ts +1 -1
- package/types/pc/badge/index.d.ts +2 -2
- package/types/pc/breadcrumb/Item.d.ts +1 -1
- package/types/pc/breadcrumb/index.d.ts +1 -1
- package/types/pc/button/Group.d.ts +1 -1
- package/types/pc/button/index.d.ts +1 -1
- package/types/pc/calendar/Month.d.ts +1 -1
- package/types/pc/calendar/Year.d.ts +1 -1
- package/types/pc/calendar/index.d.ts +1 -1
- package/types/pc/card/Grid.d.ts +1 -1
- package/types/pc/card/Meta.d.ts +1 -1
- package/types/pc/card/index.d.ts +1 -1
- package/types/pc/carousel/Arrow.d.ts +1 -1
- package/types/pc/carousel/Indicator.d.ts +1 -1
- package/types/pc/carousel/index.d.ts +2 -2
- package/types/pc/cascader/Cascader.d.ts +1 -1
- package/types/pc/cascader/util.d.ts +1 -1
- package/types/pc/checkbox/Checkbox.d.ts +1 -1
- package/types/pc/checkbox/Group.d.ts +1 -1
- package/types/pc/checkbox/GroupBlock.d.ts +1 -1
- package/types/pc/checkbox/index.d.ts +1 -1
- package/types/pc/collapse/Collapse.d.ts +1 -1
- package/types/pc/collapse/Item.d.ts +1 -1
- package/types/pc/color-picker/InputHex.d.ts +1 -1
- package/types/pc/color-picker/InputRgb.d.ts +1 -1
- package/types/pc/color-picker/Mode.d.ts +1 -1
- package/types/pc/color-picker/Palette.d.ts +1 -1
- package/types/pc/color-picker/index.d.ts +1 -1
- package/types/pc/color-picker/utils.d.ts +1 -1
- package/types/pc/comment/index.d.ts +1 -1
- package/types/pc/config-provider/ConfigProvider.d.ts +3 -2
- package/types/pc/config-provider/context.d.ts +1 -1
- package/types/pc/config-provider/interface.d.ts +1 -1
- package/types/pc/copy/index.d.ts +1 -1
- package/types/pc/date-picker/Picker.d.ts +1 -2
- package/types/pc/date-picker/RangePicker.d.ts +1 -1
- package/types/pc/date-picker/index.d.ts +1 -1
- package/types/pc/descriptions/index.d.ts +1 -1
- package/types/pc/details/index.d.ts +1 -1
- package/types/pc/divider/index.d.ts +1 -1
- package/types/pc/draggable/Item.d.ts +1 -1
- package/types/pc/draggable/index.d.ts +1 -1
- package/types/pc/drawer/Drawer.d.ts +2 -2
- package/types/pc/dropdown/Button.d.ts +1 -1
- package/types/pc/dropdown/index.d.ts +1 -1
- package/types/pc/empty/index.d.ts +1 -1
- package/types/pc/form/Control.d.ts +1 -1
- package/types/pc/form/Form.d.ts +1 -1
- package/types/pc/form/FormLabel.d.ts +1 -1
- package/types/pc/form/FormList.d.ts +1 -1
- package/types/pc/form/FormProvider.d.ts +1 -1
- package/types/pc/form/context.d.ts +1 -1
- package/types/pc/form/hook/useForm.d.ts +1 -1
- package/types/pc/form/index.d.ts +1 -1
- package/types/pc/form/interface.d.ts +2 -2
- package/types/pc/form/store.d.ts +3 -4
- package/types/pc/form/util.d.ts +3 -3
- package/types/pc/grid/Col.d.ts +1 -1
- package/types/pc/grid/Grid.d.ts +1 -1
- package/types/pc/grid/GridItem.d.ts +1 -1
- package/types/pc/grid/Row.d.ts +1 -1
- package/types/pc/grid/context.d.ts +1 -1
- package/types/pc/grid/util.d.ts +1 -1
- package/types/pc/hooks/use-watermark/index.d.ts +1 -1
- package/types/pc/icons/file/index.d.ts +1 -1
- package/types/pc/image/Image.d.ts +1 -1
- package/types/pc/image/ImageFooter.d.ts +1 -1
- package/types/pc/image/ImagePreview.d.ts +1 -1
- package/types/pc/image/ImagePreviewGroup.d.ts +1 -1
- package/types/pc/image/ImagePreviewToolbar.d.ts +1 -1
- package/types/pc/image/index.d.ts +1 -1
- package/types/pc/image/previewGroupContext.d.ts +1 -1
- package/types/pc/input/Button.d.ts +1 -1
- package/types/pc/input/Group.d.ts +1 -1
- package/types/pc/input/Input.d.ts +1 -1
- package/types/pc/input/InputElement.d.ts +1 -1
- package/types/pc/input/Password.d.ts +1 -1
- package/types/pc/input/Search.d.ts +1 -1
- package/types/pc/input/Textarea.d.ts +1 -1
- package/types/pc/input/index.d.ts +1 -1
- package/types/pc/input/useComposition.d.ts +1 -1
- package/types/pc/input-number/index.d.ts +1 -1
- package/types/pc/input-tag/InputTag.d.ts +2 -2
- package/types/pc/input-tag/interface.d.ts +2 -2
- package/types/pc/layout/Content.d.ts +1 -1
- package/types/pc/layout/Footer.d.ts +1 -1
- package/types/pc/layout/Header.d.ts +1 -1
- package/types/pc/layout/Sider.d.ts +1 -1
- package/types/pc/layout/index.d.ts +2 -2
- package/types/pc/link/index.d.ts +1 -1
- package/types/pc/list/Item.d.ts +1 -1
- package/types/pc/list/Meta.d.ts +1 -1
- package/types/pc/list/index.d.ts +2 -2
- package/types/pc/mentions/index.d.ts +1 -1
- package/types/pc/mentions/util.d.ts +1 -1
- package/types/pc/menu/Item.d.ts +1 -1
- package/types/pc/menu/ItemGroup.d.ts +1 -1
- package/types/pc/menu/Menu.d.ts +1 -1
- package/types/pc/menu/OverflowWrap.d.ts +1 -1
- package/types/pc/menu/context.d.ts +1 -1
- package/types/pc/menu/index.d.ts +1 -1
- package/types/pc/menu/interface.d.ts +1 -1
- package/types/pc/message/index.d.ts +2 -2
- package/types/pc/message/useMessage.d.ts +1 -1
- package/types/pc/modal/Modal.d.ts +2 -2
- package/types/pc/modal/config.d.ts +1 -1
- package/types/pc/notification/index.d.ts +2 -2
- package/types/pc/notification/useNotification.d.ts +1 -1
- package/types/pc/page-header/index.d.ts +2 -2
- package/types/pc/pagination/PageItem.d.ts +2 -47
- package/types/pc/pagination/Pagination.d.ts +1 -1
- package/types/pc/pagination/interface.d.ts +47 -0
- package/types/pc/popconfirm/index.d.ts +1 -1
- package/types/pc/popover/index.d.ts +1 -1
- package/types/pc/popover/interface.d.ts +1 -1
- package/types/pc/progress/CircleProgress.d.ts +1 -1
- package/types/pc/progress/index.d.ts +1 -1
- package/types/pc/radio/Group.d.ts +1 -1
- package/types/pc/radio/GroupBlock.d.ts +1 -1
- package/types/pc/radio/Radio.d.ts +1 -1
- package/types/pc/radio/index.d.ts +1 -1
- package/types/pc/rate/index.d.ts +1 -1
- package/types/pc/resize-box/Split.d.ts +1 -1
- package/types/pc/resize-box/SplitGroup.d.ts +1 -1
- package/types/pc/resize-box/index.d.ts +1 -1
- package/types/pc/result/index.d.ts +1 -1
- package/types/pc/select/OptGroup.d.ts +1 -1
- package/types/pc/select/Option.d.ts +1 -1
- package/types/pc/select/Select.d.ts +3 -2
- package/types/pc/select/index.d.ts +1 -1
- package/types/pc/select/util.d.ts +1 -1
- package/types/pc/select-view/Core.d.ts +1 -1
- package/types/pc/select-view/index.d.ts +1 -1
- package/types/pc/skeleton/Image.d.ts +1 -1
- package/types/pc/skeleton/Text.d.ts +1 -1
- package/types/pc/skeleton/index.d.ts +1 -1
- package/types/pc/slider/Button.d.ts +1 -1
- package/types/pc/slider/hook/useInterval.d.ts +1 -1
- package/types/pc/slider/index.d.ts +1 -1
- package/types/pc/space/index.d.ts +1 -1
- package/types/pc/space-/index.d.ts +1 -1
- package/types/pc/spin/index.d.ts +1 -1
- package/types/pc/statistic/Countdown.d.ts +1 -1
- package/types/pc/statistic/index.d.ts +2 -2
- package/types/pc/steps/Step.d.ts +1 -1
- package/types/pc/steps/index.d.ts +1 -1
- package/types/pc/switch/index.d.ts +2 -2
- package/types/pc/table/ColGroup.d.ts +1 -1
- package/types/pc/table/Table.d.ts +1 -1
- package/types/pc/table/constant.d.ts +1 -1
- package/types/pc/table/interface.d.ts +1 -1
- package/types/pc/table/util.d.ts +1 -1
- package/types/pc/tabs/Tab.d.ts +1 -1
- package/types/pc/tabs/TabPane.d.ts +1 -1
- package/types/pc/tabs/index.d.ts +1 -1
- package/types/pc/tabs/tab-header/TabNavIcon.d.ts +1 -1
- package/types/pc/tabs/tab-header/index.d.ts +1 -1
- package/types/pc/tag/index.d.ts +1 -1
- package/types/pc/time-picker/Picker.d.ts +1 -1
- package/types/pc/time-picker/RangePicker.d.ts +1 -1
- package/types/pc/time-picker/TimePicker.d.ts +1 -1
- package/types/pc/time-picker/index.d.ts +1 -1
- package/types/pc/timeline/Item.d.ts +1 -1
- package/types/pc/timeline/Timeline.d.ts +1 -1
- package/types/pc/timeline/index.d.ts +1 -1
- package/types/pc/tooltip/index.d.ts +2 -2
- package/types/pc/transfer/Item.d.ts +1 -1
- package/types/pc/transfer/List.d.ts +1 -1
- package/types/pc/transfer/index.d.ts +1 -1
- package/types/pc/tree/Animation.d.ts +1 -1
- package/types/pc/tree/Context.d.ts +1 -2
- package/types/pc/tree/Node.d.ts +1 -1
- package/types/pc/tree/Tree.d.ts +1 -1
- package/types/pc/tree/index.d.ts +2 -2
- package/types/pc/tree/interface.d.ts +19 -3
- package/types/pc/tree/util.d.ts +1 -1
- package/types/pc/tree-select/List.d.ts +1 -1
- package/types/pc/trigger/getPopupStyle.d.ts +1 -1
- package/types/pc/trigger/index.d.ts +2 -2
- package/types/pc/typography/EditContent.d.ts +1 -1
- package/types/pc/typography/Ellipsis.d.ts +1 -1
- package/types/pc/typography/Operations.d.ts +1 -1
- package/types/pc/typography/Paragraph.d.ts +1 -1
- package/types/pc/typography/Title.d.ts +1 -1
- package/types/pc/typography/Typography.d.ts +1 -1
- package/types/pc/typography/useCssEllipsis.d.ts +1 -1
- package/types/pc/typography/useEllipsis.d.ts +1 -1
- package/types/pc/upload/TriggerNode.d.ts +1 -1
- package/types/pc/upload/Upload.d.ts +2 -2
- package/types/pc/upload/Uploader.d.ts +1 -1
- package/types/pc/upload/request.d.ts +1 -1
- package/types/pc/upload/util.d.ts +1 -1
- package/types/pc/verification-code/VerificationCode.d.ts +1 -1
- package/types/pc/verification-code/index.d.ts +1 -1
- package/types/pc/watermark/Watermark.d.ts +1 -1
- package/types/pc/watermark/index.d.ts +2 -2
- package/typography/Ellipsis.js +3 -2
- package/version/index.js +1 -1
package/tree/Node.js
CHANGED
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import { jsxs as w, Fragment as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
1
|
+
import { jsxs as w, Fragment as z, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import G from "@unicom-cloud/icons/IconUiCaretDown";
|
|
3
|
+
import J from "@unicom-cloud/icons/IconUiDragDotVertical";
|
|
4
|
+
import K from "@unicom-cloud/icons/IconUiFile";
|
|
5
|
+
import Q from "@unicom-cloud/icons/IconUiLoading";
|
|
6
|
+
import m from "lodash/isFunction";
|
|
7
|
+
import W, { forwardRef as X, useContext as _, useRef as Z, useState as ee, useCallback as I } from "react";
|
|
8
|
+
import ne from "../checkbox/Checkbox.js";
|
|
9
|
+
import "../checkbox/Group.js";
|
|
9
10
|
import "../config-provider/ConfigProvider.js";
|
|
10
11
|
import ae from "../icon-hover/index.js";
|
|
11
12
|
import b from "@unicom-cloud/utils/class-name";
|
|
12
|
-
import { throttleByRaf as
|
|
13
|
-
import
|
|
14
|
-
import { TreeContext as
|
|
15
|
-
import
|
|
16
|
-
function
|
|
17
|
-
const
|
|
13
|
+
import { throttleByRaf as ie } from "../components/common/utils/throttleByRaf.js";
|
|
14
|
+
import oe from "./Animation.js";
|
|
15
|
+
import { TreeContext as te } from "./Context.js";
|
|
16
|
+
import re from "../config-provider/context.js";
|
|
17
|
+
function se(i, U) {
|
|
18
|
+
const n = _(te), { getPrefixCls: $ } = _(re), p = Z(), [t, f] = ee({
|
|
18
19
|
isAllowDrop: !0,
|
|
19
20
|
isDragOver: !1,
|
|
20
21
|
dragPosition: 0,
|
|
21
22
|
isDragging: !1
|
|
22
23
|
}), {
|
|
23
|
-
_key:
|
|
24
|
+
_key: h = "",
|
|
24
25
|
title: Y,
|
|
25
|
-
icon:
|
|
26
|
-
checkable:
|
|
26
|
+
icon: x,
|
|
27
|
+
checkable: O,
|
|
27
28
|
selected: F,
|
|
28
29
|
disabled: N,
|
|
29
30
|
disableCheckbox: H,
|
|
30
31
|
isLeaf: P,
|
|
31
|
-
draggable:
|
|
32
|
-
expanded:
|
|
32
|
+
draggable: l,
|
|
33
|
+
expanded: d,
|
|
33
34
|
showLine: v,
|
|
34
35
|
loading: M,
|
|
35
36
|
selectable: T = !0
|
|
@@ -38,69 +39,76 @@ function re(i, U) {
|
|
|
38
39
|
{
|
|
39
40
|
[`${o}-selected`]: F,
|
|
40
41
|
[`${o}-is-leaf`]: P,
|
|
41
|
-
[`${o}-expanded`]:
|
|
42
|
+
[`${o}-expanded`]: d,
|
|
42
43
|
[`${o}-disabled-selectable`]: !T,
|
|
43
44
|
[`${o}-disabled`]: N,
|
|
44
|
-
[`${o}-draggable`]:
|
|
45
|
+
[`${o}-draggable`]: l
|
|
45
46
|
},
|
|
46
47
|
i.className
|
|
47
48
|
), c = (() => {
|
|
48
|
-
const e =
|
|
49
|
-
return { ...e, ...
|
|
49
|
+
const e = m(n.icons) ? n.icons(i) : n.icons, a = m(i.icons) ? i.icons(i) : i.icons;
|
|
50
|
+
return { ...e, ...a };
|
|
50
51
|
})(), y = I(
|
|
51
52
|
(e) => {
|
|
52
|
-
var
|
|
53
|
-
e !==
|
|
53
|
+
var a;
|
|
54
|
+
e !== d && ((a = n.onExpand) == null || a.call(n, e, h));
|
|
54
55
|
},
|
|
55
|
-
[
|
|
56
|
+
[d, n.onExpand]
|
|
56
57
|
), A = I(async () => {
|
|
57
|
-
var
|
|
58
|
-
const { isLeaf: e, expanded:
|
|
59
|
-
e || (!((
|
|
60
|
-
}, [i, y,
|
|
58
|
+
var s;
|
|
59
|
+
const { isLeaf: e, expanded: a } = i;
|
|
60
|
+
e || (!((s = i.childrenData) != null && s.length) && m(n.loadMore) && !a ? await n.loadMore(i) : y(!a));
|
|
61
|
+
}, [i, y, n.loadMore]), B = () => {
|
|
61
62
|
if (M)
|
|
62
|
-
return "loadingIcon" in c ? c.loadingIcon : /* @__PURE__ */
|
|
63
|
-
let e = null,
|
|
63
|
+
return "loadingIcon" in c ? c.loadingIcon : /* @__PURE__ */ r(Q, {});
|
|
64
|
+
let e = null, a = !1;
|
|
64
65
|
if (P)
|
|
65
|
-
v && (e = "switcherIcon" in c ? c.switcherIcon : /* @__PURE__ */
|
|
66
|
+
v && (e = "switcherIcon" in c ? c.switcherIcon : /* @__PURE__ */ r(K, {}), a = !0);
|
|
66
67
|
else {
|
|
67
|
-
const
|
|
68
|
-
e = "switcherIcon" in c ? c.switcherIcon :
|
|
68
|
+
const s = v ? /* @__PURE__ */ r("span", { className: `${o}-${d ? "minus" : "plus"}-icon` }) : /* @__PURE__ */ r(G, {});
|
|
69
|
+
e = "switcherIcon" in c ? c.switcherIcon : s, a = !v;
|
|
69
70
|
}
|
|
70
71
|
if (e)
|
|
71
|
-
return e = /* @__PURE__ */
|
|
72
|
+
return e = /* @__PURE__ */ r(
|
|
72
73
|
"span",
|
|
73
74
|
{
|
|
74
75
|
className: `${o}-switcher-icon`,
|
|
75
|
-
"aria-label":
|
|
76
|
+
"aria-label": d ? "fold button" : "expand button",
|
|
76
77
|
role: "button",
|
|
77
78
|
tabIndex: 0,
|
|
78
79
|
onClick: A,
|
|
79
80
|
children: e
|
|
80
81
|
}
|
|
81
|
-
),
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
var
|
|
85
|
-
const
|
|
86
|
-
if (!
|
|
82
|
+
), a ? /* @__PURE__ */ r(ae, { prefix: o, children: e }) : e;
|
|
83
|
+
}, u = I(
|
|
84
|
+
ie((e) => {
|
|
85
|
+
var R;
|
|
86
|
+
const a = p.current;
|
|
87
|
+
if (!a)
|
|
87
88
|
return;
|
|
88
|
-
const
|
|
89
|
+
const s = a.getBoundingClientRect(), g = window.pageYOffset + s.top, D = e.pageY, E = s.height / 4, L = D - g, k = L < E ? -1 : L < s.height - E ? 0 : 1, q = n.allowDrop(i, k);
|
|
89
90
|
f({
|
|
90
91
|
...t,
|
|
91
|
-
isAllowDrop:
|
|
92
|
+
isAllowDrop: q,
|
|
92
93
|
isDragOver: !0,
|
|
93
94
|
dragPosition: k
|
|
94
|
-
}), (
|
|
95
|
+
}), (R = n.onNodeDragOver) == null || R.call(n, e, i, k);
|
|
95
96
|
}),
|
|
96
|
-
[
|
|
97
|
+
[n.onNodeDragOver]
|
|
97
98
|
);
|
|
98
|
-
function
|
|
99
|
-
var
|
|
100
|
-
const { disableCheckbox:
|
|
101
|
-
|
|
99
|
+
function C(e, a) {
|
|
100
|
+
var D;
|
|
101
|
+
const { disableCheckbox: s, disabled: g } = i;
|
|
102
|
+
s || g || (D = n.onCheck) == null || D.call(n, e, h, a);
|
|
102
103
|
}
|
|
103
|
-
|
|
104
|
+
function V(e) {
|
|
105
|
+
const { onSelect: a, actionOnClick: s } = n;
|
|
106
|
+
if (i.disabled)
|
|
107
|
+
return;
|
|
108
|
+
const g = [].concat(s);
|
|
109
|
+
T && g.indexOf("select") > -1 && (a == null || a(h, e)), g.indexOf("expand") > -1 && A(), O && g.indexOf("check") > -1 && C(!i.checked, e);
|
|
110
|
+
}
|
|
111
|
+
return /* @__PURE__ */ w(z, { children: [
|
|
104
112
|
/* @__PURE__ */ w(
|
|
105
113
|
"div",
|
|
106
114
|
{
|
|
@@ -109,106 +117,100 @@ function re(i, U) {
|
|
|
109
117
|
ref: U,
|
|
110
118
|
role: "treeitem",
|
|
111
119
|
"aria-disabled": N,
|
|
112
|
-
"aria-expanded":
|
|
120
|
+
"aria-expanded": d,
|
|
113
121
|
"aria-level": i._level,
|
|
114
122
|
children: [
|
|
115
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ r("span", { className: `${o}-indent`, "aria-hidden": !0, children: [...Array(i._level)].map((e, a) => /* @__PURE__ */ r(
|
|
116
124
|
"span",
|
|
117
125
|
{
|
|
118
126
|
className: b(`${o}-indent-block`, {
|
|
119
|
-
[`${o}-indent-block-lineless`]: i._lineless && i._lineless[
|
|
127
|
+
[`${o}-indent-block-lineless`]: i._lineless && i._lineless[a]
|
|
120
128
|
})
|
|
121
129
|
},
|
|
122
|
-
|
|
130
|
+
a
|
|
123
131
|
)) }),
|
|
124
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ r(
|
|
125
133
|
"span",
|
|
126
134
|
{
|
|
127
135
|
className: b(`${o}-switcher`, {
|
|
128
|
-
[`${o}-switcher-expanded`]:
|
|
136
|
+
[`${o}-switcher-expanded`]: d
|
|
129
137
|
}),
|
|
130
138
|
children: B()
|
|
131
139
|
}
|
|
132
140
|
),
|
|
133
|
-
|
|
134
|
-
|
|
141
|
+
O ? /* @__PURE__ */ r(
|
|
142
|
+
ne,
|
|
135
143
|
{
|
|
136
144
|
disabled: H || N,
|
|
137
|
-
value:
|
|
145
|
+
value: h,
|
|
138
146
|
indeterminate: i.indeterminated,
|
|
139
147
|
checked: i.checked,
|
|
140
|
-
onChange:
|
|
148
|
+
onChange: C
|
|
141
149
|
}
|
|
142
150
|
) : null,
|
|
143
151
|
/* @__PURE__ */ w(
|
|
144
152
|
"span",
|
|
145
153
|
{
|
|
146
154
|
"aria-grabbed": t.isDragging,
|
|
147
|
-
ref:
|
|
155
|
+
ref: p,
|
|
148
156
|
className: b(`${o}-title`, {
|
|
149
|
-
[`${o}-title-draggable`]:
|
|
157
|
+
[`${o}-title-draggable`]: l,
|
|
150
158
|
[`${o}-title-gap-top`]: t.isDragOver && t.isAllowDrop && t.dragPosition < 0,
|
|
151
159
|
[`${o}-title-gap-bottom`]: t.isDragOver && t.isAllowDrop && t.dragPosition > 0,
|
|
152
160
|
[`${o}-title-highlight`]: !t.isDragging && t.isDragOver && t.isAllowDrop && t.dragPosition === 0,
|
|
153
161
|
[`${o}-title-dragging`]: t.isDragging,
|
|
154
162
|
[`${o}-title-block`]: i.blockNode
|
|
155
163
|
}),
|
|
156
|
-
onClick:
|
|
157
|
-
|
|
158
|
-
if (!i.disabled) {
|
|
159
|
-
const l = [].concat(h);
|
|
160
|
-
T && l.indexOf("select") > -1 && (n == null || n(m, e)), l.indexOf("expand") > -1 && A(), p && l.indexOf("check") > -1 && E(!i.checked, e), r == null || r(m, i.dataRef, i);
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
draggable: d,
|
|
164
|
+
onClick: V,
|
|
165
|
+
draggable: l,
|
|
164
166
|
onDrop: (e) => {
|
|
165
|
-
var
|
|
166
|
-
e.stopPropagation(), e.preventDefault(), (
|
|
167
|
+
var a;
|
|
168
|
+
e.stopPropagation(), e.preventDefault(), (a = n.onNodeDrop) == null || a.call(n, e, i, t.dragPosition), u.cancel(), f({
|
|
167
169
|
...t,
|
|
168
170
|
isDragOver: !1,
|
|
169
171
|
dragPosition: 0
|
|
170
172
|
});
|
|
171
173
|
},
|
|
172
174
|
onDragStart: (e) => {
|
|
173
|
-
var
|
|
174
|
-
if (
|
|
175
|
+
var a;
|
|
176
|
+
if (l) {
|
|
175
177
|
e.stopPropagation(), f({ ...t, isDragging: !0 });
|
|
176
178
|
try {
|
|
177
179
|
e.dataTransfer.setData("text/plain", "");
|
|
178
|
-
} catch (
|
|
179
|
-
console.error(
|
|
180
|
+
} catch (s) {
|
|
181
|
+
console.error(s);
|
|
180
182
|
}
|
|
181
|
-
(
|
|
183
|
+
(a = n.onNodeDragStart) == null || a.call(n, e, i);
|
|
182
184
|
}
|
|
183
185
|
},
|
|
184
186
|
onDragEnd: (e) => {
|
|
185
|
-
var
|
|
186
|
-
|
|
187
|
+
var a;
|
|
188
|
+
l && (e.stopPropagation(), u.cancel(), f({ ...t, isDragOver: !1, isDragging: !1 }), (a = n.onNodeDragEnd) == null || a.call(n, e, i));
|
|
187
189
|
},
|
|
188
190
|
onDragOver: (e) => {
|
|
189
|
-
e.preventDefault(), e.stopPropagation(), e.persist(),
|
|
191
|
+
e.preventDefault(), e.stopPropagation(), e.persist(), u(e);
|
|
190
192
|
},
|
|
191
193
|
onDragLeave: (e) => {
|
|
192
|
-
var
|
|
193
|
-
|
|
194
|
+
var a;
|
|
195
|
+
l && (e.stopPropagation(), u.cancel(), f({ ...t, isDragOver: !1 }), (a = n.onNodeDragLeave) == null || a.call(n, e, i));
|
|
194
196
|
},
|
|
195
197
|
children: [
|
|
196
|
-
|
|
197
|
-
/* @__PURE__ */
|
|
198
|
-
|
|
198
|
+
x && /* @__PURE__ */ r("span", { className: `${o}-icon ${o}-custom-icon`, children: x }),
|
|
199
|
+
/* @__PURE__ */ r("span", { className: `${o}-title-text`, children: m(n.renderTitle) ? n.renderTitle(i) : Y }),
|
|
200
|
+
l && /* @__PURE__ */ r("span", { className: `${o}-icon ${o}-drag-icon`, children: "dragIcon" in c ? c.dragIcon : /* @__PURE__ */ r(J, {}) })
|
|
199
201
|
]
|
|
200
202
|
}
|
|
201
203
|
),
|
|
202
|
-
|
|
204
|
+
m(n.renderExtra) && n.renderExtra(i)
|
|
203
205
|
]
|
|
204
206
|
}
|
|
205
207
|
),
|
|
206
|
-
|
|
208
|
+
n.animation && /* @__PURE__ */ r(oe, { ...i })
|
|
207
209
|
] });
|
|
208
210
|
}
|
|
209
|
-
const S =
|
|
211
|
+
const S = X(se);
|
|
210
212
|
S.displayName = "TreeNode";
|
|
211
|
-
const
|
|
213
|
+
const pe = W.memo(S);
|
|
212
214
|
export {
|
|
213
|
-
|
|
215
|
+
pe as default
|
|
214
216
|
};
|