@unicom-cloud/ui 0.8.95 → 0.8.97
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/Carousel.js +1 -1
- package/LiquidFill.js +4 -0
- package/Message.js +1 -1
- package/Notification.js +1 -1
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/QrCode.js +57 -0
- package/Switch.js +1 -1
- package/Tour.js +63 -0
- package/Trigger.js +2 -2
- package/_virtual/_commonjsHelpers.js +6 -0
- package/_virtual/index.js +7 -0
- package/_virtual/index2.js +4 -0
- package/affix/index.js +70 -72
- package/alert/index.js +52 -51
- package/anchor/Anchor.js +55 -55
- package/anchor/Link.js +34 -34
- package/anchor/util.js +5 -5
- package/auto-complete/index.js +116 -122
- package/avatar/Avatar.js +33 -33
- package/avatar/Group.js +26 -26
- package/back-top/index.js +58 -61
- package/badge/index.js +46 -46
- package/breadcrumb/Item.js +42 -43
- package/breadcrumb/index.js +47 -47
- package/button/Group.js +6 -6
- package/button/index.js +91 -91
- package/calendar/Month.js +75 -75
- package/calendar/Year.js +35 -35
- package/calendar/header/index.js +25 -25
- package/calendar/index.js +103 -103
- package/card/Grid.js +8 -8
- package/card/Meta.js +16 -16
- package/card/index.js +49 -49
- package/carousel/Arrow.js +19 -19
- package/carousel/Indicator.js +26 -26
- package/carousel/index.js +108 -108
- package/cascader/Cascader.js +178 -191
- package/cascader/base/node.js +133 -136
- package/cascader/base/store.js +82 -85
- package/cascader/panel/List.js +126 -130
- package/cascader/panel/Search.js +79 -81
- package/cascader/util.js +13 -13
- package/checkbox/Checkbox.js +94 -96
- package/checkbox/Group.js +54 -56
- package/checkbox/GroupBlock.js +28 -29
- package/collapse/Collapse.js +45 -45
- package/collapse/Item.js +53 -55
- package/color-picker/ControlBar.js +43 -43
- package/color-picker/InputAlpha.js +12 -12
- package/color-picker/InputHex.js +30 -31
- package/color-picker/InputRgb.js +24 -24
- package/color-picker/Palette.js +18 -18
- package/color-picker/Panel.js +122 -125
- package/color-picker/hooks/useColorPicker.js +85 -88
- package/color-picker/hooks/useControlBlock.js +38 -40
- package/color-picker/index.js +47 -47
- package/comment/index.js +29 -29
- package/components/common/higher-order/with-speech-synthesis/index.js +37 -40
- package/components/common/hooks/useForceUpdate.js +6 -2
- package/components/common/hooks/useId.js +4 -4
- package/components/common/hooks/useInView.js +16 -16
- package/components/common/hooks/useIntersectionObserver.js +1 -1
- package/components/common/hooks/useKeyboardEvent.js +9 -10
- package/components/common/hooks/useOverflowHidden.js +1 -4
- package/components/common/hooks/usePersistCallback.js +7 -7
- package/components/common/hooks/useStateCallback.js +9 -10
- package/components/common/hooks/useWindowSize.js +8 -8
- package/components/common/space/index.js +11 -10
- package/components/common/utils/PqbCSSTransition.js +1 -1
- package/components/common/utils/convertToDurationBasedOnTimeUnits.js +6 -0
- package/components/common/utils/dom.js +27 -29
- package/components/common/utils/findScrollParent.js +17 -0
- package/components/common/utils/intersectionObserver.js +21 -0
- package/components/common/utils/is.js +99 -109
- package/components/common/utils/mutationObserver.js +19 -0
- package/components/common/utils/reactDOM.js +34 -34
- package/components/common/utils/resizeObserver.js +21 -0
- package/copy/index.js +38 -40
- package/date-picker/Picker.js +290 -295
- package/date-picker/RangePicker.js +367 -372
- package/date-picker/index.js +33 -35
- package/date-picker/panel/Body.js +46 -47
- package/date-picker/panel/Header.js +33 -33
- package/date-picker/panel/Shortcut.js +31 -31
- package/date-picker/panel/date/index.js +85 -85
- package/date-picker/panel/month/index.js +59 -59
- package/date-picker/panel/quarter/index.js +67 -70
- package/date-picker/panel/range/index.js +101 -101
- package/date-picker/panel/year/index.js +39 -39
- package/date-picker/util.js +17 -18
- package/descriptions/index.js +62 -62
- package/details/index.js +55 -56
- package/development/index.js +9 -9
- package/dist/react-transition-group/src/CSSTransition.js +1 -1
- package/dist/react-transition-group/src/SwitchTransition.js +1 -1
- package/dist/tinycolor/chunk/BOzCVdr0.js +1 -1
- package/dist/tween/src/tween.js +24 -25
- package/dist/validate/src/index.js +5 -5
- package/dist/validate/src/util.js +1 -1
- package/divider/index.js +21 -21
- package/draggable/Item.js +35 -35
- package/draggable/index.js +22 -22
- package/drawer/Drawer.js +142 -147
- package/dropdown/Button.js +48 -48
- package/dropdown/index.js +88 -92
- package/empty/index.js +16 -16
- package/form/Control.js +211 -225
- package/form/Form.js +109 -113
- package/form/FormItem.js +118 -120
- package/form/FormList.js +60 -66
- package/form/FormProvider.js +31 -34
- package/form/hook/useContext.js +17 -19
- package/form/hook/useState.js +22 -23
- package/form/hook/useWatch.js +26 -27
- package/form/promisify.js +14 -18
- package/form/store.js +304 -316
- package/form/util.js +14 -15
- package/grid/Col.js +64 -64
- package/grid/Grid.js +51 -51
- package/grid/GridItem.js +48 -48
- package/grid/Row.js +39 -39
- package/hooks/index.js +50 -52
- package/hooks/useVerificationCode.js +41 -43
- package/hooks/useWatermark.js +89 -92
- package/icon/index.js +23 -24
- package/icon-hover/index.js +16 -16
- package/icons/file.js +11 -11
- package/image/Image.js +140 -141
- package/image/ImagePreview.js +252 -255
- package/image/ImagePreviewArrow.js +25 -25
- package/image/ImagePreviewGroup.js +62 -62
- package/image/util/getScale.js +25 -28
- package/index.js +682 -679
- package/input/Button.js +48 -50
- package/input/Group.js +9 -9
- package/input/Input.js +145 -154
- package/input/InputElement.js +108 -115
- package/input/Password.js +38 -38
- package/input/Search.js +51 -55
- package/input/Textarea.js +80 -81
- package/input/useComposition.js +23 -23
- package/input-number/decimal.js +59 -62
- package/input-number/index.js +139 -141
- package/input-tag/InputTag.js +223 -231
- package/layout/Content.js +6 -6
- package/layout/Footer.js +8 -8
- package/layout/Header.js +7 -7
- package/layout/Sider.js +88 -90
- package/layout/index.js +30 -30
- package/link/index.js +45 -46
- package/liquid-fill/LiquidFill.js +189 -0
- package/liquid-fill/LiquidFill2.js +3 -0
- package/liquid-fill/index.js +4 -0
- package/liquid-fill/interface.js +1 -0
- package/list/Item.js +28 -28
- package/list/Meta.js +12 -12
- package/list/index.js +146 -148
- package/mentions/index.js +75 -76
- package/menu/Item.js +58 -58
- package/menu/Menu.js +125 -127
- package/menu/OverflowWrap.js +39 -40
- package/menu/sub-menu/Inline.js +45 -45
- package/menu/util.js +26 -28
- package/message/index.js +97 -100
- package/message/useMessage.js +26 -27
- package/modal/Confirm.js +47 -49
- package/modal/Modal.js +250 -257
- package/modal/use-modal/Hook.js +26 -28
- package/modal/use-modal/index.js +46 -49
- package/notice/index.js +89 -90
- package/notification/index.js +61 -66
- package/notification/withNotification.js +35 -35
- package/overflow-ellipsis/OverflowItem.js +19 -20
- package/overflow-ellipsis/index.js +45 -46
- package/package.json +1 -1
- package/page-header/index.js +45 -45
- package/pagination/PageItem.js +87 -91
- package/pagination/PageJumper.js +40 -41
- package/pagination/PageOption.js +31 -35
- package/pagination/Pagination.js +162 -163
- package/picker/Input.js +90 -96
- package/picker/InputRange.js +115 -122
- package/popconfirm/index.js +98 -100
- package/popover/index.js +28 -28
- package/portal/Portal.js +10 -11
- package/progress/index.js +36 -36
- package/qr-code/index.js +99 -0
- package/qr-code/interface.js +1 -0
- package/radio/Group.js +48 -48
- package/radio/GroupBlock.js +32 -33
- package/radio/Radio.js +62 -64
- package/rate/index.js +88 -88
- package/resize-box/ResizeTrigger.js +39 -39
- package/resize-box/Split.js +92 -96
- package/resize-box/SplitGroup.js +116 -122
- package/resize-box/index.js +112 -115
- package/result/index.js +44 -44
- package/select/Option.js +53 -56
- package/select/Select.js +365 -381
- package/select/util.js +95 -99
- package/select-view/Core.js +159 -160
- package/skeleton/index.js +23 -23
- package/slider/Button.js +84 -92
- package/slider/Input.js +47 -49
- package/slider/Tick.js +28 -31
- package/slider/index.js +108 -108
- package/slider/util.js +1 -1
- package/space/index.js +26 -26
- package/space-/index.js +51 -51
- package/spin/DotLoading.js +8 -8
- package/spin/index.js +47 -47
- package/statistic/Countdown.js +37 -37
- package/statistic/index.js +61 -61
- package/steps/Step.js +42 -42
- package/steps/index.js +54 -54
- package/style.css +1 -1
- package/switch/index.js +78 -79
- package/table/ColGroup.js +36 -37
- package/table/Table.js +447 -450
- package/table/hook/useExpand.js +24 -24
- package/table/hook/useRowSelection.js +62 -62
- package/table/summary/Row.js +16 -17
- package/table/tbody/Td.js +119 -118
- package/table/tbody/Tr.js +119 -121
- package/table/tbody/index.js +62 -63
- package/table/th-resizable/index.js +30 -30
- package/table/thead/Column.js +148 -148
- package/table/thead/index.js +87 -88
- package/tabs/Tab.js +55 -55
- package/tabs/TabContent.js +8 -8
- package/tabs/TabPane.js +15 -15
- package/tabs/hook/useHeaderScroll.js +36 -36
- package/tabs/tab-header/TabInk.js +31 -33
- package/tabs/tab-header/TabNavIcon.js +34 -35
- package/tabs/tab-header/index.js +192 -195
- package/tag/index.js +94 -97
- package/time-picker/Picker.js +167 -172
- package/time-picker/RangePicker.js +28 -28
- package/time-picker/TimePicker.js +146 -146
- package/time-picker/util.js +4 -4
- package/timeline/Item.js +46 -46
- package/timeline/Timeline.js +52 -52
- package/tooltip/index.js +89 -95
- package/tour/index.js +289 -0
- package/transfer/Item.js +54 -54
- package/transfer/List.js +134 -136
- package/transfer/index.js +91 -91
- package/tree/Animation.js +49 -52
- package/tree/Node.js +114 -122
- package/tree/NodeList.js +51 -51
- package/tree/Tree.js +386 -393
- package/tree-select/List.js +71 -72
- package/tree-select/Select.js +135 -143
- package/tree-select/hook/useKeyCache.js +39 -39
- package/tree-select/hook/useStateValue.js +12 -12
- package/trigger/getPopupStyle.js +60 -61
- package/trigger/index.js +338 -347
- package/types/common/space/interface.d.ts +1 -1
- package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
- package/types/common/utils/findScrollParent.d.ts +2 -0
- package/types/common/utils/index.d.ts +5 -0
- package/types/common/utils/intersectionObserver.d.ts +2 -0
- package/types/common/utils/math.d.ts +1 -1
- package/types/common/utils/mutationObserver.d.ts +2 -0
- package/types/common/utils/resizeObserver.d.ts +2 -0
- package/types/pc/alert/interface.d.ts +2 -2
- package/types/pc/details/interface.d.ts +2 -2
- package/types/pc/hooks/index.d.ts +0 -1
- package/types/pc/index.d.ts +3 -0
- package/types/pc/liquid-fill/LiquidFill.d.ts +30 -0
- package/types/pc/liquid-fill/LiquidFill2.d.ts +1 -0
- package/types/pc/liquid-fill/index.d.ts +4 -0
- package/types/pc/liquid-fill/interface.d.ts +0 -0
- package/types/pc/qr-code/index.d.ts +34 -0
- package/types/pc/qr-code/interface.d.ts +39 -0
- package/types/pc/table/interface.d.ts +2 -2
- package/types/pc/tour/index.d.ts +42 -0
- package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
- package/types/pc/utils/findScrollParent.d.ts +2 -0
- package/types/pc/utils/index.d.ts +5 -0
- package/types/pc/utils/intersectionObserver.d.ts +2 -0
- package/types/pc/utils/math.d.ts +1 -1
- package/types/pc/utils/mutationObserver.d.ts +2 -0
- package/types/pc/utils/names.d.ts +18 -0
- package/types/pc/utils/resizeObserver.d.ts +2 -0
- package/typography/Base.js +79 -81
- package/typography/EditContent.js +30 -33
- package/typography/Ellipsis.js +78 -75
- package/typography/Operations.js +50 -52
- package/typography/Paragraph.js +7 -7
- package/typography/Typography.js +7 -7
- package/typography/useEllipsis.js +105 -106
- package/upload/TriggerNode.js +69 -76
- package/upload/Upload.js +84 -87
- package/upload/Uploader.js +115 -118
- package/upload/list/PictureItem.js +61 -71
- package/upload/list/TextItem.js +61 -67
- package/upload/list/UploadProgress.js +42 -49
- package/upload/list/index.js +49 -50
- package/upload/request_.js +37 -38
- package/upload/util.js +39 -39
- package/utils/convertToDurationBasedOnTimeUnits.js +6 -0
- package/utils/findScrollParent.js +4 -0
- package/utils/index.js +274 -275
- package/utils/intersectionObserver.js +4 -0
- package/utils/math.js +7 -11
- package/utils/mutationObserver.js +4 -0
- package/utils/names.js +12 -0
- package/utils/reactTransitionGroup.js +1 -1
- package/utils/resizeObserver.js +4 -0
- package/verification-code/VerificationCode.js +50 -51
- package/version/index.js +1 -1
- package/virtual-list/VirtualList.js +243 -244
- package/virtual-list/util/item.js +3 -4
- package/watermark/Watermark.js +27 -31
- package/components/common/hooks/useComputedState.js +0 -11
- package/components/common/utils/resizeObserverEffect.js +0 -23
- package/hooks/useComputedState.js +0 -4
- package/types/common/hooks/useComputedState.d.ts +0 -4
- package/types/common/utils/resizeObserverEffect.d.ts +0 -2
- package/types/pc/hooks/useComputedState.d.ts +0 -1
- package/types/pc/utils/resizeObserverEffect.d.ts +0 -2
- package/utils/resizeObserverEffect.js +0 -4
- /package/dist/react-transition-group/chunk/{C6QwjD4L.js → CPfP7aNL.js} +0 -0
package/tree/Tree.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { isEmptyObject as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
1
|
+
import { jsx as ce } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Oe, useContext as Pe, useRef as O, useState as ve, useImperativeHandle as Te, useEffect as j, createElement as Ae } from "react";
|
|
3
|
+
import { isEmptyObject as Ie } from "@unicom-cloud/utils/is";
|
|
4
|
+
import _ from "lodash/get";
|
|
5
|
+
import p from "lodash/has";
|
|
6
|
+
import Me from "lodash/isArray";
|
|
7
|
+
import b from "lodash/isEqualWith";
|
|
8
|
+
import He from "lodash/isFunction";
|
|
9
|
+
import re from "lodash/isUndefined";
|
|
10
10
|
import "../config-provider/ConfigProvider.js";
|
|
11
|
-
import
|
|
12
|
-
import { pickDataAttributes as
|
|
13
|
-
import { TreeContext as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { getTreeDataFromTreeChildren as
|
|
17
|
-
import
|
|
18
|
-
const
|
|
11
|
+
import se from "@unicom-cloud/utils/class-name";
|
|
12
|
+
import { pickDataAttributes as $e } from "../components/common/utils/pick.js";
|
|
13
|
+
import { TreeContext as Re } from "./Context.js";
|
|
14
|
+
import de from "./Node.js";
|
|
15
|
+
import We from "./NodeList.js";
|
|
16
|
+
import { getTreeDataFromTreeChildren as je, getCheckedKeysByInitKeys as pe, getAllCheckedKeysByCheck as Fe } from "./util.js";
|
|
17
|
+
import ze from "../config-provider/context.js";
|
|
18
|
+
const le = {
|
|
19
19
|
key: "key",
|
|
20
20
|
title: "title",
|
|
21
21
|
children: "children",
|
|
@@ -24,15 +24,15 @@ const oe = {
|
|
|
24
24
|
disableCheckbox: "disableCheckbox",
|
|
25
25
|
checkable: "checkable",
|
|
26
26
|
isLeaf: "isLeaf"
|
|
27
|
-
}, ae = "parent",
|
|
27
|
+
}, ae = "parent", ie = "all", oe = "child", Be = {
|
|
28
28
|
selectable: !0,
|
|
29
29
|
autoExpandParent: !0,
|
|
30
|
-
checkedStrategy:
|
|
30
|
+
checkedStrategy: ie,
|
|
31
31
|
actionOnClick: "select",
|
|
32
32
|
allowDrop: () => !0,
|
|
33
|
-
fieldNames:
|
|
33
|
+
fieldNames: le,
|
|
34
34
|
animation: !0
|
|
35
|
-
},
|
|
35
|
+
}, qe = [
|
|
36
36
|
"style",
|
|
37
37
|
"className",
|
|
38
38
|
"height",
|
|
@@ -49,18 +49,17 @@ const oe = {
|
|
|
49
49
|
"actionOnClick",
|
|
50
50
|
"animation"
|
|
51
51
|
];
|
|
52
|
-
function
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
s.checkedKeys || s.defaultCheckedKeys || []
|
|
52
|
+
function Ue(r, fe) {
|
|
53
|
+
const L = Pe(ze), F = O(null), y = O({}), N = O(), v = O(), A = O(), [f, k] = ve(() => {
|
|
54
|
+
const e = I(), n = M(e, L.getPrefixCls?.("tree")), { checkedKeys: s, halfCheckedKeys: t } = H(
|
|
55
|
+
r.checkedKeys || r.defaultCheckedKeys || []
|
|
57
56
|
);
|
|
58
57
|
return {
|
|
59
|
-
selectedKeys:
|
|
60
|
-
checkedKeys:
|
|
58
|
+
selectedKeys: r.selectedKeys || r.defaultSelectedKeys || [],
|
|
59
|
+
checkedKeys: s,
|
|
61
60
|
halfCheckedKeys: t,
|
|
62
|
-
expandedKeys:
|
|
63
|
-
|
|
61
|
+
expandedKeys: B(
|
|
62
|
+
r.expandedKeys || r.defaultExpandedKeys
|
|
64
63
|
),
|
|
65
64
|
loadedKeys: [],
|
|
66
65
|
loadingKeys: [],
|
|
@@ -68,24 +67,24 @@ function Ge(s, fe) {
|
|
|
68
67
|
nodeList: n
|
|
69
68
|
};
|
|
70
69
|
});
|
|
71
|
-
function
|
|
72
|
-
const { componentConfig: n } =
|
|
73
|
-
return
|
|
74
|
-
|
|
75
|
-
}),
|
|
70
|
+
function m(e) {
|
|
71
|
+
const { componentConfig: n } = L ?? {}, s = e || r, t = n?.Tree || {}, d = {};
|
|
72
|
+
return qe.forEach((c) => {
|
|
73
|
+
re(s[c]) ? re(t[c]) ? d[c] = Be[c] : d[c] = t[c] : d[c] = s[c];
|
|
74
|
+
}), d;
|
|
76
75
|
}
|
|
77
|
-
function
|
|
78
|
-
let
|
|
79
|
-
n && (
|
|
80
|
-
|
|
81
|
-
n ||
|
|
76
|
+
function ye(e, n) {
|
|
77
|
+
let s = e;
|
|
78
|
+
n && (s = n._key), A.current && A.current.scrollIntoView(
|
|
79
|
+
s,
|
|
80
|
+
n || y.current[s]
|
|
82
81
|
);
|
|
83
82
|
}
|
|
84
|
-
function
|
|
85
|
-
return "treeData" in
|
|
83
|
+
function I() {
|
|
84
|
+
return "treeData" in r ? r.treeData : je(r.children);
|
|
86
85
|
}
|
|
87
|
-
function
|
|
88
|
-
const
|
|
86
|
+
function he(e, n) {
|
|
87
|
+
const s = [
|
|
89
88
|
"fieldNames",
|
|
90
89
|
"selectable",
|
|
91
90
|
"draggable",
|
|
@@ -96,502 +95,496 @@ function Ge(s, fe) {
|
|
|
96
95
|
"treeData",
|
|
97
96
|
"children"
|
|
98
97
|
];
|
|
99
|
-
return e.treeData !== n.treeData || e.children !== n.children ||
|
|
98
|
+
return e.treeData !== n.treeData || e.children !== n.children || s.some((t) => b(e[t], n[t]));
|
|
100
99
|
}
|
|
101
|
-
function
|
|
102
|
-
const n =
|
|
103
|
-
...
|
|
104
|
-
..."treeData" in
|
|
105
|
-
},
|
|
106
|
-
children:
|
|
107
|
-
selectable:
|
|
108
|
-
checkable:
|
|
109
|
-
title:
|
|
110
|
-
disabled:
|
|
111
|
-
disableCheckbox:
|
|
112
|
-
isLeaf:
|
|
113
|
-
key:
|
|
100
|
+
function z(e) {
|
|
101
|
+
const n = m(), { selectable: s } = n, t = {
|
|
102
|
+
...le,
|
|
103
|
+
..."treeData" in r ? n.fieldNames : {}
|
|
104
|
+
}, d = {
|
|
105
|
+
children: _(e, t.children),
|
|
106
|
+
selectable: p(e, t.selectable) ? _(e, t.selectable) : s,
|
|
107
|
+
checkable: p(e, t.checkable) ? _(e, t.checkable) : r.checkable,
|
|
108
|
+
title: _(e, t.title),
|
|
109
|
+
disabled: _(e, t.disabled),
|
|
110
|
+
disableCheckbox: _(e, t.disableCheckbox),
|
|
111
|
+
isLeaf: _(e, t.isLeaf),
|
|
112
|
+
key: _(e, t.key)
|
|
114
113
|
};
|
|
115
|
-
return
|
|
114
|
+
return p(e, t.key) || delete d.key, d;
|
|
116
115
|
}
|
|
117
|
-
function
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return C.map((m, x) => {
|
|
116
|
+
function M(e, n) {
|
|
117
|
+
y.current = {};
|
|
118
|
+
const s = n || L.getPrefixCls?.("tree"), t = [];
|
|
119
|
+
let d = 0;
|
|
120
|
+
const { showLine: c, blockNode: a } = m(), l = (h, o) => {
|
|
121
|
+
const D = h.length;
|
|
122
|
+
return h.map((x, g) => {
|
|
125
123
|
const {
|
|
126
|
-
children:
|
|
127
|
-
selectable:
|
|
128
|
-
checkable:
|
|
129
|
-
key:
|
|
130
|
-
...
|
|
131
|
-
} =
|
|
124
|
+
children: K,
|
|
125
|
+
selectable: i,
|
|
126
|
+
checkable: S,
|
|
127
|
+
key: C = `${o?._key || ""}-${g}`,
|
|
128
|
+
...W
|
|
129
|
+
} = z(x), E = {
|
|
132
130
|
// data 中含有 dataRef 时,优先级较高
|
|
133
|
-
dataRef:
|
|
134
|
-
draggable:
|
|
135
|
-
selectable:
|
|
136
|
-
checkable:
|
|
137
|
-
showLine:
|
|
138
|
-
blockNode:
|
|
139
|
-
...
|
|
140
|
-
...
|
|
141
|
-
key:
|
|
142
|
-
children:
|
|
143
|
-
_key:
|
|
144
|
-
_index:
|
|
145
|
-
parentKey:
|
|
146
|
-
pathParentKeys:
|
|
147
|
-
_level:
|
|
131
|
+
dataRef: x,
|
|
132
|
+
draggable: r.draggable,
|
|
133
|
+
selectable: i,
|
|
134
|
+
checkable: S,
|
|
135
|
+
showLine: c,
|
|
136
|
+
blockNode: a,
|
|
137
|
+
...x,
|
|
138
|
+
...W,
|
|
139
|
+
key: C,
|
|
140
|
+
children: K,
|
|
141
|
+
_key: C,
|
|
142
|
+
_index: d++,
|
|
143
|
+
parentKey: o ? o._key : void 0,
|
|
144
|
+
pathParentKeys: o && o.pathParentKeys || [],
|
|
145
|
+
_level: o._level || 0,
|
|
148
146
|
// 保存node在sowLine模式下是否显示缩进线。如果父节点是其所在层级的最后一个节点,那么所有的子节点(包括孙子节点等)在父节点所在层级的缩进格都不显示缩进线。
|
|
149
|
-
_lineless:
|
|
147
|
+
_lineless: o && o._lineless ? [...o._lineless || [], o._isTail] : []
|
|
150
148
|
};
|
|
151
|
-
return
|
|
152
|
-
`${
|
|
153
|
-
|
|
154
|
-
)), t.push(
|
|
155
|
-
_key:
|
|
156
|
-
_level:
|
|
157
|
-
_lineless:
|
|
158
|
-
_isTail:
|
|
159
|
-
pathParentKeys: [...
|
|
160
|
-
})),
|
|
149
|
+
return D === g + 1 && (E.className = se(
|
|
150
|
+
`${s}-node-is-tail`,
|
|
151
|
+
E.className
|
|
152
|
+
)), t.push(E), y.current[C] = E, K && K.length && (y.current[C].children = l(K, {
|
|
153
|
+
_key: C,
|
|
154
|
+
_level: E._level + 1,
|
|
155
|
+
_lineless: E._lineless,
|
|
156
|
+
_isTail: D === g + 1,
|
|
157
|
+
pathParentKeys: [...o?.pathParentKeys || [], C]
|
|
158
|
+
})), E;
|
|
161
159
|
});
|
|
162
160
|
};
|
|
163
|
-
return
|
|
161
|
+
return l(e || [], {}), t;
|
|
164
162
|
}
|
|
165
|
-
function
|
|
166
|
-
if (!
|
|
163
|
+
function B(e) {
|
|
164
|
+
if (!m().autoExpandParent)
|
|
167
165
|
return e || [];
|
|
168
166
|
if (!e)
|
|
169
|
-
return Object.keys(
|
|
170
|
-
const t =
|
|
167
|
+
return Object.keys(y.current).filter((s) => {
|
|
168
|
+
const t = y.current[s];
|
|
171
169
|
return t.children && t.children.length;
|
|
172
170
|
});
|
|
173
171
|
const n = {};
|
|
174
|
-
return e.forEach((
|
|
175
|
-
const t =
|
|
176
|
-
t && (n[
|
|
177
|
-
n[
|
|
172
|
+
return e.forEach((s) => {
|
|
173
|
+
const t = y.current[s];
|
|
174
|
+
t && (n[s] = 1, t.pathParentKeys && t.pathParentKeys.forEach((d) => {
|
|
175
|
+
n[d] = 1;
|
|
178
176
|
}));
|
|
179
177
|
}), Object.keys(n);
|
|
180
178
|
}
|
|
181
|
-
function
|
|
182
|
-
if (!
|
|
183
|
-
const { checkedKeys: n, indeterminateKeys:
|
|
179
|
+
function H(e) {
|
|
180
|
+
if (!r.checkStrictly) {
|
|
181
|
+
const { checkedKeys: n, indeterminateKeys: s } = pe(
|
|
184
182
|
e,
|
|
185
|
-
|
|
183
|
+
y.current
|
|
186
184
|
);
|
|
187
185
|
return {
|
|
188
186
|
checkedKeys: n,
|
|
189
|
-
halfCheckedKeys:
|
|
187
|
+
halfCheckedKeys: s
|
|
190
188
|
};
|
|
191
189
|
}
|
|
192
190
|
return {
|
|
193
191
|
checkedKeys: e,
|
|
194
|
-
halfCheckedKeys:
|
|
192
|
+
halfCheckedKeys: r.halfCheckedKeys || []
|
|
195
193
|
};
|
|
196
194
|
}
|
|
197
|
-
function
|
|
198
|
-
|
|
199
|
-
const { onSelect: c, onNodeSelect: t } = s, l = (i = f.current[e]) == null ? void 0 : i.dataRef, r = {
|
|
195
|
+
function ue(e, n) {
|
|
196
|
+
const { onSelect: s, onNodeSelect: t } = r, d = y.current[e]?.dataRef, c = {
|
|
200
197
|
e: n,
|
|
201
|
-
data:
|
|
198
|
+
data: d,
|
|
202
199
|
// 潘启宝添加
|
|
203
|
-
node:
|
|
200
|
+
node: u([e])[0],
|
|
204
201
|
selected: !1,
|
|
205
202
|
selectedNodes: []
|
|
206
203
|
};
|
|
207
|
-
if (
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
const
|
|
211
|
-
return
|
|
212
|
-
}),
|
|
204
|
+
if (r.multiple) {
|
|
205
|
+
const a = [...f.selectedKeys], l = a.indexOf(e);
|
|
206
|
+
l > -1 ? (a.splice(l, 1), c.selected = !1) : (c.selected = !0, a.push(e)), c.selectedNodes = u(a), "selectedKeys" in r || k((h) => {
|
|
207
|
+
const o = { ...h };
|
|
208
|
+
return o.selectedKeys = a, o;
|
|
209
|
+
}), s?.(a, c);
|
|
213
210
|
} else
|
|
214
|
-
|
|
215
|
-
const
|
|
216
|
-
return
|
|
217
|
-
}),
|
|
218
|
-
t
|
|
211
|
+
c.selected = !0, c.selectedNodes = u([e]), "selectedKeys" in r || k((a) => {
|
|
212
|
+
const l = { ...a };
|
|
213
|
+
return l.selectedKeys = [e], l;
|
|
214
|
+
}), s?.([e], c);
|
|
215
|
+
t?.(e, d, c);
|
|
219
216
|
}
|
|
220
|
-
function
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
"checkedKeys" in s || (m.checkedKeys = d), "halfCheckedKeys" in s || (m.halfCheckedKeys = y), Me(m) || k((x) => ({ ...x, ...m }));
|
|
217
|
+
function q(e, n, s) {
|
|
218
|
+
const { checkedStrategy: t } = m(), { checkStrictly: d, onCheck: c, onNodeCheck: a } = r;
|
|
219
|
+
let l = [...f.checkedKeys || []], h = f.halfCheckedKeys;
|
|
220
|
+
if (d) {
|
|
221
|
+
e ? l = l.concat(n) : l = l.filter((g) => g !== n);
|
|
222
|
+
const x = {};
|
|
223
|
+
"checkedKeys" in r || (x.checkedKeys = l), "halfCheckedKeys" in r || (x.halfCheckedKeys = h), Ie(x) || k((g) => ({ ...g, ...x }));
|
|
228
224
|
} else {
|
|
229
|
-
const { checkedKeys:
|
|
225
|
+
const { checkedKeys: x, indeterminateKeys: g } = Fe(
|
|
230
226
|
n,
|
|
231
227
|
e,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
228
|
+
l,
|
|
229
|
+
y.current,
|
|
230
|
+
h
|
|
235
231
|
);
|
|
236
|
-
|
|
237
|
-
const
|
|
238
|
-
return
|
|
239
|
-
}) : k((
|
|
240
|
-
const
|
|
241
|
-
return
|
|
242
|
-
}), t === ae ?
|
|
243
|
-
const
|
|
244
|
-
if (!
|
|
232
|
+
l = x, h = g, "checkedKeys" in r ? k((K) => {
|
|
233
|
+
const i = { ...K };
|
|
234
|
+
return i.halfCheckedKeys = h, i;
|
|
235
|
+
}) : k((K) => {
|
|
236
|
+
const i = { ...K };
|
|
237
|
+
return i.checkedKeys = l, i.halfCheckedKeys = h, i;
|
|
238
|
+
}), t === ae ? l = l.filter((K) => {
|
|
239
|
+
const i = y.current[K];
|
|
240
|
+
if (!i || l.indexOf(i.parentKey) === -1)
|
|
245
241
|
return !0;
|
|
246
|
-
}) : t ===
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
if (!h || !((D = h.children) != null && D.length) || (N = h.children) != null && N.every((z) => d.indexOf(z._key) === -1))
|
|
242
|
+
}) : t === oe && (l = l.filter((K) => {
|
|
243
|
+
const i = y.current[K];
|
|
244
|
+
if (!i || !i.children?.length || i.children?.every((S) => l.indexOf(S._key) === -1))
|
|
250
245
|
return !0;
|
|
251
246
|
}));
|
|
252
247
|
}
|
|
253
|
-
const
|
|
254
|
-
checkedNodes:
|
|
248
|
+
const o = y.current[n]?.dataRef, D = {
|
|
249
|
+
checkedNodes: u(l),
|
|
255
250
|
checked: e,
|
|
256
|
-
halfCheckedKeys:
|
|
257
|
-
halfCheckedNodes:
|
|
258
|
-
data:
|
|
251
|
+
halfCheckedKeys: h,
|
|
252
|
+
halfCheckedNodes: u(h),
|
|
253
|
+
data: o,
|
|
259
254
|
// 潘启宝添加
|
|
260
|
-
e:
|
|
261
|
-
node:
|
|
255
|
+
e: s,
|
|
256
|
+
node: u([n])[0]
|
|
262
257
|
};
|
|
263
|
-
|
|
258
|
+
c?.(l, D), a?.(n, o, D);
|
|
264
259
|
}
|
|
265
|
-
function
|
|
266
|
-
if (
|
|
267
|
-
const { loadingKeys: n = [], loadedKeys:
|
|
260
|
+
function Ke(e) {
|
|
261
|
+
if (He(r.loadMore)) {
|
|
262
|
+
const { loadingKeys: n = [], loadedKeys: s } = f;
|
|
268
263
|
k((t) => {
|
|
269
|
-
const
|
|
270
|
-
return
|
|
271
|
-
}),
|
|
272
|
-
k((
|
|
273
|
-
const
|
|
274
|
-
return
|
|
275
|
-
}),
|
|
264
|
+
const d = { ...t };
|
|
265
|
+
return d.loadingKeys = Array.from(/* @__PURE__ */ new Set([...n, e._key])), d.loadedKeys = s.filter((c) => c !== e._key), d;
|
|
266
|
+
}), te?.(u([e._key])[0]).then((t) => {
|
|
267
|
+
k((d) => {
|
|
268
|
+
const c = { ...d };
|
|
269
|
+
return c.loadingKeys = d.loadingKeys.filter((a) => a !== e._key), c.loadedKeys = Array.from(/* @__PURE__ */ new Set([...d.loadedKeys, e._key])), c;
|
|
270
|
+
}), $(!e.expanded, e._key);
|
|
276
271
|
}).catch((t) => {
|
|
277
|
-
k((
|
|
278
|
-
const
|
|
279
|
-
return
|
|
272
|
+
k((d) => {
|
|
273
|
+
const c = { ...d };
|
|
274
|
+
return c.loadingKeys = d.loadingKeys.filter((a) => a !== e._key), c;
|
|
280
275
|
}), console.error("[tree]load data error: ", t);
|
|
281
276
|
}).finally(() => {
|
|
282
277
|
});
|
|
283
278
|
}
|
|
284
279
|
}
|
|
280
|
+
function ke(e, n) {
|
|
281
|
+
N.current = u([n._key])[0], v.current = 0;
|
|
282
|
+
const { onDragStart: s } = r;
|
|
283
|
+
s?.(e, u([n._key])[0]);
|
|
284
|
+
}
|
|
285
285
|
function xe(e, n) {
|
|
286
|
-
|
|
287
|
-
const {
|
|
288
|
-
|
|
286
|
+
N.current = null, v.current = 0;
|
|
287
|
+
const { onDragEnd: s } = r;
|
|
288
|
+
s?.(e, u([n._key])[0]);
|
|
289
289
|
}
|
|
290
|
-
function
|
|
291
|
-
|
|
292
|
-
const {
|
|
293
|
-
|
|
290
|
+
function me(e, n, s) {
|
|
291
|
+
v.current = s;
|
|
292
|
+
const { onDragOver: t } = r;
|
|
293
|
+
t?.(e, u([n._key])[0]);
|
|
294
294
|
}
|
|
295
|
-
function
|
|
296
|
-
|
|
297
|
-
const {
|
|
298
|
-
|
|
295
|
+
function ge(e, n) {
|
|
296
|
+
v.current = 0;
|
|
297
|
+
const { onDragLeave: s } = r;
|
|
298
|
+
s?.(e, u([n._key])[0]);
|
|
299
299
|
}
|
|
300
300
|
function Ce(e, n) {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
}
|
|
305
|
-
function Ne(e, n) {
|
|
306
|
-
let c = f.current[e.parentKey];
|
|
307
|
-
for (; c; ) {
|
|
308
|
-
const { _key: t, parentKey: l } = c;
|
|
301
|
+
let s = y.current[e.parentKey];
|
|
302
|
+
for (; s; ) {
|
|
303
|
+
const { _key: t, parentKey: d } = s;
|
|
309
304
|
if (t === n.props._key)
|
|
310
305
|
return !0;
|
|
311
|
-
if (
|
|
306
|
+
if (d === t)
|
|
312
307
|
return;
|
|
313
|
-
|
|
308
|
+
s = y.current[d];
|
|
314
309
|
}
|
|
315
310
|
}
|
|
316
|
-
function
|
|
311
|
+
function U(e, n) {
|
|
317
312
|
if (e === void 0 || n === void 0)
|
|
318
313
|
return !1;
|
|
319
314
|
if (e === n)
|
|
320
315
|
return !0;
|
|
321
|
-
const
|
|
322
|
-
if (
|
|
323
|
-
return
|
|
324
|
-
const
|
|
325
|
-
return
|
|
316
|
+
const s = e.key, t = n.key;
|
|
317
|
+
if (s !== void 0 || t !== void 0)
|
|
318
|
+
return s === t;
|
|
319
|
+
const d = e.props._key, c = n.props._key;
|
|
320
|
+
return d === void 0 && c === void 0 ? !1 : d === c;
|
|
326
321
|
}
|
|
327
|
-
function
|
|
328
|
-
if (
|
|
329
|
-
const { allowDrop: t } =
|
|
330
|
-
if (
|
|
322
|
+
function V(e, n, s) {
|
|
323
|
+
if (N.current) {
|
|
324
|
+
const { allowDrop: t } = m(), { onDrop: d } = r, c = u([n._key])[0];
|
|
325
|
+
if (d && !Ce(n, N.current) && !U(N.current, c)) {
|
|
331
326
|
if (t && !t({
|
|
332
|
-
dropNode:
|
|
333
|
-
dragNode:
|
|
334
|
-
dropPosition:
|
|
327
|
+
dropNode: c,
|
|
328
|
+
dragNode: N.current,
|
|
329
|
+
dropPosition: s
|
|
335
330
|
}))
|
|
336
331
|
return;
|
|
337
|
-
|
|
338
|
-
dragNode:
|
|
339
|
-
dropNode:
|
|
340
|
-
dropPosition:
|
|
332
|
+
d({
|
|
333
|
+
dragNode: N.current,
|
|
334
|
+
dropNode: c,
|
|
335
|
+
dropPosition: s,
|
|
341
336
|
e
|
|
342
337
|
});
|
|
343
338
|
}
|
|
344
339
|
}
|
|
345
340
|
}
|
|
346
|
-
function
|
|
347
|
-
const { allowDrop:
|
|
341
|
+
function G(e, n) {
|
|
342
|
+
const { allowDrop: s } = m();
|
|
348
343
|
let t = !0;
|
|
349
|
-
return typeof
|
|
350
|
-
dropNode:
|
|
351
|
-
dragNode:
|
|
344
|
+
return typeof s == "function" && (t = s({
|
|
345
|
+
dropNode: u([e._key])[0],
|
|
346
|
+
dragNode: N.current,
|
|
352
347
|
dropPosition: n
|
|
353
348
|
})), t;
|
|
354
349
|
}
|
|
355
|
-
function
|
|
356
|
-
const { currentExpandKeys:
|
|
357
|
-
if (
|
|
350
|
+
function $(e, n) {
|
|
351
|
+
const { currentExpandKeys: s, expandedKeys: t = [] } = f, { animation: d } = m(), { onExpand: c } = r;
|
|
352
|
+
if (s.indexOf(n) > -1)
|
|
358
353
|
return;
|
|
359
|
-
let
|
|
360
|
-
e ?
|
|
361
|
-
const
|
|
362
|
-
return
|
|
363
|
-
}),
|
|
354
|
+
let a = [];
|
|
355
|
+
e ? a = Array.from(/* @__PURE__ */ new Set([...t, n])) : a = t.filter((l) => l !== n), "expandedKeys" in r || k((l) => {
|
|
356
|
+
const h = { ...l };
|
|
357
|
+
return h.expandedKeys = a, h.currentExpandKeys = d ? [...s, n] : [], h;
|
|
358
|
+
}), c?.(a, {
|
|
364
359
|
expanded: e,
|
|
365
|
-
node:
|
|
366
|
-
expandedNodes:
|
|
360
|
+
node: u([n])[0],
|
|
361
|
+
expandedNodes: u(a)
|
|
367
362
|
});
|
|
368
363
|
}
|
|
369
|
-
function
|
|
370
|
-
const { __PqbAdapterMode__: n } =
|
|
371
|
-
return
|
|
372
|
-
[].concat(e).map((t) =>
|
|
364
|
+
function u(e) {
|
|
365
|
+
const { __PqbAdapterMode__: n } = r;
|
|
366
|
+
return T(
|
|
367
|
+
[].concat(e).map((t) => y.current[t]).filter(Boolean)
|
|
373
368
|
).map((t) => n ? {
|
|
374
369
|
props: t,
|
|
375
370
|
key: e
|
|
376
|
-
} : /* @__PURE__ */
|
|
371
|
+
} : /* @__PURE__ */ Ae(de, { ...t, key: t.key }));
|
|
377
372
|
}
|
|
378
|
-
function
|
|
373
|
+
function R(e) {
|
|
379
374
|
return {
|
|
380
|
-
expandedKeysSet:
|
|
381
|
-
checkedKeysSet:
|
|
382
|
-
selectedKeysSet:
|
|
383
|
-
halfCheckedKeysSet:
|
|
375
|
+
expandedKeysSet: e?.expandedKeysSet || new Set(f?.expandedKeys || []),
|
|
376
|
+
checkedKeysSet: e?.checkedKeysSet || new Set(f?.checkedKeys || []),
|
|
377
|
+
selectedKeysSet: e?.selectedKeysSet || new Set(f?.selectedKeys || []),
|
|
378
|
+
halfCheckedKeysSet: e?.halfCheckedKeysSet || new Set(f?.halfCheckedKeys || [])
|
|
384
379
|
};
|
|
385
380
|
}
|
|
386
|
-
function
|
|
387
|
-
const { autoExpandParent:
|
|
388
|
-
selectedKeys:
|
|
389
|
-
expandedKeys:
|
|
390
|
-
checkedKeys:
|
|
391
|
-
loadingKeys:
|
|
392
|
-
loadedKeys:
|
|
393
|
-
} =
|
|
394
|
-
expandedKeysSet:
|
|
395
|
-
checkedKeysSet:
|
|
396
|
-
selectedKeysSet:
|
|
397
|
-
halfCheckedKeysSet:
|
|
398
|
-
} =
|
|
399
|
-
const
|
|
400
|
-
isLeaf: !
|
|
401
|
-
autoExpandParent:
|
|
402
|
-
expanded:
|
|
381
|
+
function T(e, n) {
|
|
382
|
+
const { autoExpandParent: s } = m(), { loadMore: t } = r, {
|
|
383
|
+
selectedKeys: d,
|
|
384
|
+
expandedKeys: c,
|
|
385
|
+
checkedKeys: a,
|
|
386
|
+
loadingKeys: l = [],
|
|
387
|
+
loadedKeys: h = []
|
|
388
|
+
} = f, {
|
|
389
|
+
expandedKeysSet: o,
|
|
390
|
+
checkedKeysSet: D,
|
|
391
|
+
selectedKeysSet: x,
|
|
392
|
+
halfCheckedKeysSet: g
|
|
393
|
+
} = R(n), K = (i) => {
|
|
394
|
+
const S = i.children && i.children.length, C = {
|
|
395
|
+
isLeaf: !S,
|
|
396
|
+
autoExpandParent: S ? s : !1,
|
|
397
|
+
expanded: o ? o.has(i._key) : c.indexOf(i._key) > -1
|
|
403
398
|
};
|
|
404
399
|
if (t) {
|
|
405
|
-
const
|
|
406
|
-
|
|
400
|
+
const W = h.indexOf(i._key) > -1;
|
|
401
|
+
C.loaded = W, C.isLeaf = S ? !1 : i.isLeaf;
|
|
407
402
|
}
|
|
408
403
|
return {
|
|
409
|
-
...
|
|
410
|
-
...
|
|
411
|
-
selected:
|
|
412
|
-
indeterminated:
|
|
413
|
-
loading:
|
|
414
|
-
checked:
|
|
415
|
-
selectedKeys:
|
|
416
|
-
checkedKeys:
|
|
417
|
-
loadingKeys:
|
|
418
|
-
loadedKeys:
|
|
419
|
-
expandedKeys:
|
|
420
|
-
childrenData:
|
|
404
|
+
...i,
|
|
405
|
+
...C,
|
|
406
|
+
selected: x.has(i._key),
|
|
407
|
+
indeterminated: g.has(i._key),
|
|
408
|
+
loading: l.indexOf(i._key) > -1,
|
|
409
|
+
checked: D.has(i._key),
|
|
410
|
+
selectedKeys: d,
|
|
411
|
+
checkedKeys: a,
|
|
412
|
+
loadingKeys: l,
|
|
413
|
+
loadedKeys: h,
|
|
414
|
+
expandedKeys: c,
|
|
415
|
+
childrenData: i.children || [],
|
|
421
416
|
children: null
|
|
422
417
|
};
|
|
423
418
|
};
|
|
424
|
-
return
|
|
419
|
+
return Me(e) ? e.map((i) => K(i)) : K(e);
|
|
425
420
|
}
|
|
426
|
-
function
|
|
421
|
+
function J(e) {
|
|
427
422
|
k((n) => {
|
|
428
|
-
const
|
|
429
|
-
return t.indexOf(e) > -1 && (
|
|
423
|
+
const s = { ...n }, { currentExpandKeys: t } = n;
|
|
424
|
+
return t.indexOf(e) > -1 && (s.currentExpandKeys = t.filter((d, c, a) => d !== e)), s;
|
|
430
425
|
});
|
|
431
426
|
}
|
|
432
|
-
function
|
|
433
|
-
return
|
|
427
|
+
function Q() {
|
|
428
|
+
return f;
|
|
434
429
|
}
|
|
435
|
-
|
|
436
|
-
scrollIntoView:
|
|
437
|
-
handleCheck:
|
|
438
|
-
getTreeState:
|
|
439
|
-
handleExpandEnd:
|
|
440
|
-
getNodeProps:
|
|
441
|
-
getDataSet:
|
|
442
|
-
getCacheNode:
|
|
443
|
-
handleExpand:
|
|
444
|
-
handleAllowDrop:
|
|
445
|
-
handleNodeDrop:
|
|
446
|
-
isSameNode:
|
|
447
|
-
})),
|
|
448
|
-
const e =
|
|
449
|
-
if (e !==
|
|
430
|
+
Te(fe, () => ({
|
|
431
|
+
scrollIntoView: ye,
|
|
432
|
+
handleCheck: q,
|
|
433
|
+
getTreeState: Q,
|
|
434
|
+
handleExpandEnd: J,
|
|
435
|
+
getNodeProps: T,
|
|
436
|
+
getDataSet: R,
|
|
437
|
+
getCacheNode: u,
|
|
438
|
+
handleExpand: $,
|
|
439
|
+
handleAllowDrop: G,
|
|
440
|
+
handleNodeDrop: V,
|
|
441
|
+
isSameNode: U
|
|
442
|
+
})), j(() => {
|
|
443
|
+
const e = F.current, n = m(e), s = m();
|
|
444
|
+
if (e !== r || !b(n, s)) {
|
|
450
445
|
const t = {};
|
|
451
|
-
if (
|
|
446
|
+
if (he(
|
|
452
447
|
{ prevMergedProps: n, ...e },
|
|
453
|
-
{ ...
|
|
448
|
+
{ ...s, ...r }
|
|
454
449
|
)) {
|
|
455
|
-
const
|
|
456
|
-
t.treeData =
|
|
450
|
+
const c = I(), a = M(c);
|
|
451
|
+
t.treeData = c, t.nodeList = a;
|
|
457
452
|
}
|
|
458
|
-
if (t.treeData || "checkedKeys" in
|
|
459
|
-
const
|
|
460
|
-
|
|
453
|
+
if (t.treeData || "checkedKeys" in r && !b(e?.checkedKeys, r.checkedKeys)) {
|
|
454
|
+
const c = "checkedKeys" in r ? r.checkedKeys : f.checkedKeys, { halfCheckedKeys: a, checkedKeys: l } = H(
|
|
455
|
+
c || []
|
|
461
456
|
);
|
|
462
|
-
|
|
457
|
+
b(l, f.checkedKeys) || (t.checkedKeys = l), b(a, f.halfCheckedKeys) || (t.halfCheckedKeys = a);
|
|
463
458
|
}
|
|
464
|
-
|
|
465
|
-
const
|
|
466
|
-
return
|
|
467
|
-
}, []).filter((
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
return f.current[r].pathParentKeys.some((u) => d.indexOf(u) > -1) ? !1 : (y = f.current[r].children) == null ? void 0 : y.length;
|
|
459
|
+
r.checkStrictly && "halfCheckedKeys" in r && !b(e?.halfCheckedKeys, r.halfCheckedKeys) && (t.halfCheckedKeys = r.halfCheckedKeys), "expandedKeys" in r && !b(r.expandedKeys, e?.expandedKeys) && (t.expandedKeys = r.expandedKeys, t.currentExpandKeys = s.animation ? [...t.expandedKeys ?? [], ...f.expandedKeys ?? []].reduce((c, a) => {
|
|
460
|
+
const l = c.indexOf(a);
|
|
461
|
+
return l === -1 ? c.push(a) : c.splice(l, 1), c;
|
|
462
|
+
}, []).filter((c, a, l) => {
|
|
463
|
+
if (y.current[c])
|
|
464
|
+
return y.current[c].pathParentKeys.some((o) => l.indexOf(o) > -1) ? !1 : y.current[c].children?.length;
|
|
471
465
|
}) : []);
|
|
472
|
-
const
|
|
473
|
-
t.treeData &&
|
|
474
|
-
const
|
|
475
|
-
return
|
|
476
|
-
})), Object.keys(t).length && k((
|
|
466
|
+
const d = t.currentExpandKeys || f.currentExpandKeys;
|
|
467
|
+
t.treeData && d && (t.currentExpandKeys = d.filter((c) => {
|
|
468
|
+
const a = t.treeData.find((l) => l.key === c);
|
|
469
|
+
return a && a.children && a.children.length;
|
|
470
|
+
})), Object.keys(t).length && k((c) => ({ ...c, ...t }));
|
|
477
471
|
}
|
|
478
|
-
return
|
|
472
|
+
return F.current = r, () => {
|
|
479
473
|
};
|
|
480
|
-
}),
|
|
474
|
+
}), j(() => ("selectedKeys" in r && !b(r.selectedKeys, f.selectedKeys) && k((e) => {
|
|
481
475
|
const n = { ...e };
|
|
482
|
-
return n.selectedKeys =
|
|
476
|
+
return n.selectedKeys = r.selectedKeys || [], n;
|
|
483
477
|
}), () => {
|
|
484
|
-
}), [
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
s.checkedKeys || s.defaultCheckedKeys || []
|
|
478
|
+
}), [r.selectedKeys, f.selectedKeys]), j(() => {
|
|
479
|
+
const e = I(), n = M(e, L.getPrefixCls?.("tree")), { checkedKeys: s, halfCheckedKeys: t } = H(
|
|
480
|
+
r.checkedKeys || r.defaultCheckedKeys || []
|
|
488
481
|
);
|
|
489
|
-
return k((
|
|
490
|
-
let
|
|
491
|
-
return
|
|
492
|
-
...
|
|
493
|
-
selectedKeys:
|
|
494
|
-
checkedKeys:
|
|
482
|
+
return k((d) => {
|
|
483
|
+
let c = { ...d };
|
|
484
|
+
return c = {
|
|
485
|
+
...c,
|
|
486
|
+
selectedKeys: r.selectedKeys || r.defaultSelectedKeys || [],
|
|
487
|
+
checkedKeys: s,
|
|
495
488
|
halfCheckedKeys: t,
|
|
496
|
-
expandedKeys:
|
|
497
|
-
|
|
489
|
+
expandedKeys: B(
|
|
490
|
+
r.expandedKeys || r.defaultExpandedKeys
|
|
498
491
|
),
|
|
499
492
|
loadedKeys: [],
|
|
500
493
|
loadingKeys: [],
|
|
501
494
|
currentExpandKeys: [],
|
|
502
495
|
nodeList: n
|
|
503
|
-
},
|
|
496
|
+
}, c;
|
|
504
497
|
}), () => {
|
|
505
498
|
};
|
|
506
499
|
}, []);
|
|
507
500
|
const {
|
|
508
|
-
className:
|
|
509
|
-
showLine:
|
|
510
|
-
size:
|
|
511
|
-
virtualListProps:
|
|
512
|
-
height:
|
|
513
|
-
style:
|
|
514
|
-
icons:
|
|
515
|
-
actionOnClick:
|
|
516
|
-
animation:
|
|
517
|
-
} =
|
|
501
|
+
className: Ne,
|
|
502
|
+
showLine: _e,
|
|
503
|
+
size: X,
|
|
504
|
+
virtualListProps: Y,
|
|
505
|
+
height: Z,
|
|
506
|
+
style: be,
|
|
507
|
+
icons: De,
|
|
508
|
+
actionOnClick: Se,
|
|
509
|
+
animation: ee
|
|
510
|
+
} = m(), { loadMore: te, checkable: Ee } = r, ne = Y ? {
|
|
518
511
|
threshold: 100,
|
|
519
|
-
...
|
|
520
|
-
} :
|
|
512
|
+
...Y
|
|
513
|
+
} : Z ? { height: Z, threshold: 100 } : {
|
|
521
514
|
threshold: null
|
|
522
|
-
}, { getPrefixCls:
|
|
523
|
-
return /* @__PURE__ */
|
|
524
|
-
|
|
515
|
+
}, { getPrefixCls: Le, rtl: we } = L, w = Le?.("tree");
|
|
516
|
+
return /* @__PURE__ */ ce(
|
|
517
|
+
Re.Provider,
|
|
525
518
|
{
|
|
526
519
|
value: {
|
|
527
|
-
icons:
|
|
528
|
-
animation:
|
|
529
|
-
key2nodeProps:
|
|
530
|
-
getFieldInfo:
|
|
531
|
-
getTreeState:
|
|
532
|
-
getNodeProps:
|
|
533
|
-
onExpandEnd:
|
|
520
|
+
icons: De,
|
|
521
|
+
animation: ee,
|
|
522
|
+
key2nodeProps: y.current,
|
|
523
|
+
getFieldInfo: z,
|
|
524
|
+
getTreeState: Q,
|
|
525
|
+
getNodeProps: T,
|
|
526
|
+
onExpandEnd: ee ? J : () => {
|
|
534
527
|
},
|
|
535
|
-
onSelect:
|
|
536
|
-
onCheck:
|
|
537
|
-
onNodeDragStart:
|
|
538
|
-
onNodeDragEnd:
|
|
539
|
-
onNodeDragLeave:
|
|
540
|
-
onNodeDragOver:
|
|
541
|
-
onNodeDrop:
|
|
542
|
-
onExpand:
|
|
543
|
-
renderExtra:
|
|
544
|
-
renderTitle:
|
|
545
|
-
loadMore:
|
|
546
|
-
allowDrop:
|
|
547
|
-
actionOnClick:
|
|
548
|
-
virtualListProps:
|
|
528
|
+
onSelect: ue,
|
|
529
|
+
onCheck: q,
|
|
530
|
+
onNodeDragStart: ke,
|
|
531
|
+
onNodeDragEnd: xe,
|
|
532
|
+
onNodeDragLeave: ge,
|
|
533
|
+
onNodeDragOver: me,
|
|
534
|
+
onNodeDrop: V,
|
|
535
|
+
onExpand: $,
|
|
536
|
+
renderExtra: r.renderExtra,
|
|
537
|
+
renderTitle: r.renderTitle,
|
|
538
|
+
loadMore: te && Ke,
|
|
539
|
+
allowDrop: G,
|
|
540
|
+
actionOnClick: Se,
|
|
541
|
+
virtualListProps: ne
|
|
549
542
|
},
|
|
550
|
-
children: /* @__PURE__ */
|
|
551
|
-
|
|
543
|
+
children: /* @__PURE__ */ ce(
|
|
544
|
+
We,
|
|
552
545
|
{
|
|
553
546
|
ref: (e) => {
|
|
554
|
-
|
|
547
|
+
A.current = e;
|
|
555
548
|
},
|
|
556
|
-
className:
|
|
557
|
-
|
|
549
|
+
className: se(
|
|
550
|
+
w,
|
|
558
551
|
{
|
|
559
|
-
[`${
|
|
560
|
-
[`${
|
|
561
|
-
[`${
|
|
562
|
-
[`${
|
|
552
|
+
[`${w}-checkable`]: Ee,
|
|
553
|
+
[`${w}-show-line`]: _e,
|
|
554
|
+
[`${w}-size-${X}`]: X,
|
|
555
|
+
[`${w}-rtl`]: we
|
|
563
556
|
},
|
|
564
|
-
|
|
557
|
+
Ne
|
|
565
558
|
),
|
|
566
|
-
style:
|
|
567
|
-
filterNode:
|
|
568
|
-
virtualListProps:
|
|
569
|
-
expandedKeys:
|
|
570
|
-
currentExpandKeys:
|
|
571
|
-
getNodeProps:
|
|
572
|
-
getDataSet:
|
|
573
|
-
nodeList:
|
|
574
|
-
onMouseDown:
|
|
559
|
+
style: be,
|
|
560
|
+
filterNode: r.filterNode,
|
|
561
|
+
virtualListProps: ne,
|
|
562
|
+
expandedKeys: f.expandedKeys,
|
|
563
|
+
currentExpandKeys: f.currentExpandKeys,
|
|
564
|
+
getNodeProps: T,
|
|
565
|
+
getDataSet: R,
|
|
566
|
+
nodeList: f.nodeList,
|
|
567
|
+
onMouseDown: r.onMouseDown,
|
|
575
568
|
ariaProps: {
|
|
576
569
|
role: "tree",
|
|
577
|
-
"aria-multiselectable":
|
|
570
|
+
"aria-multiselectable": r.multiple,
|
|
578
571
|
tabIndex: 0,
|
|
579
|
-
|
|
572
|
+
...$e(r)
|
|
580
573
|
}
|
|
581
574
|
}
|
|
582
575
|
)
|
|
583
576
|
}
|
|
584
577
|
);
|
|
585
578
|
}
|
|
586
|
-
const
|
|
587
|
-
|
|
579
|
+
const P = Oe(
|
|
580
|
+
Ue
|
|
588
581
|
);
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
582
|
+
P.displayName = "Tree";
|
|
583
|
+
P.SHOW_PARENT = ae;
|
|
584
|
+
P.SHOW_ALL = ie;
|
|
585
|
+
P.SHOW_CHILD = oe;
|
|
586
|
+
P.Node = de;
|
|
594
587
|
export {
|
|
595
|
-
|
|
596
|
-
|
|
588
|
+
de as TreeNode,
|
|
589
|
+
P as default
|
|
597
590
|
};
|