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