@unicom-cloud/ui 0.8.96 → 0.8.98

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 (302) hide show
  1. package/Affix.js +1 -1
  2. package/Carousel.js +1 -1
  3. package/LiquidFill.js +4 -0
  4. package/OverflowEllipsis.js +1 -1
  5. package/PageHeader.js +1 -1
  6. package/QrCode.js +57 -0
  7. package/Tour.js +63 -0
  8. package/Trigger.js +1 -1
  9. package/_virtual/_commonjsHelpers.js +6 -0
  10. package/_virtual/index.js +7 -0
  11. package/_virtual/index2.js +4 -0
  12. package/affix/index.js +70 -72
  13. package/alert/index.js +56 -56
  14. package/anchor/Anchor.js +55 -55
  15. package/anchor/Link.js +34 -34
  16. package/anchor/util.js +5 -5
  17. package/auto-complete/index.js +116 -122
  18. package/avatar/Avatar.js +33 -33
  19. package/avatar/Group.js +26 -26
  20. package/back-top/index.js +58 -61
  21. package/badge/index.js +46 -46
  22. package/breadcrumb/Item.js +42 -43
  23. package/breadcrumb/index.js +47 -47
  24. package/button/Group.js +6 -6
  25. package/button/index.js +91 -91
  26. package/calendar/Month.js +75 -75
  27. package/calendar/Year.js +35 -35
  28. package/calendar/header/index.js +25 -25
  29. package/calendar/index.js +103 -103
  30. package/card/Grid.js +8 -8
  31. package/card/Meta.js +16 -16
  32. package/card/index.js +49 -49
  33. package/carousel/Arrow.js +19 -19
  34. package/carousel/Indicator.js +26 -26
  35. package/carousel/index.js +108 -108
  36. package/cascader/Cascader.js +178 -191
  37. package/cascader/base/node.js +133 -136
  38. package/cascader/base/store.js +82 -85
  39. package/cascader/panel/List.js +125 -129
  40. package/cascader/panel/Search.js +79 -81
  41. package/cascader/util.js +13 -13
  42. package/checkbox/Checkbox.js +94 -96
  43. package/checkbox/Group.js +54 -56
  44. package/checkbox/GroupBlock.js +28 -29
  45. package/collapse/Collapse.js +45 -45
  46. package/collapse/Item.js +53 -55
  47. package/color-picker/ControlBar.js +43 -43
  48. package/color-picker/InputAlpha.js +12 -12
  49. package/color-picker/InputHex.js +30 -31
  50. package/color-picker/InputRgb.js +24 -24
  51. package/color-picker/Palette.js +18 -18
  52. package/color-picker/Panel.js +122 -125
  53. package/color-picker/hooks/useColorPicker.js +85 -88
  54. package/color-picker/hooks/useControlBlock.js +38 -40
  55. package/color-picker/index.js +47 -47
  56. package/comment/index.js +29 -29
  57. package/components/common/higher-order/with-speech-synthesis/index.js +37 -40
  58. package/components/common/hooks/useId.js +8 -8
  59. package/components/common/hooks/useInView.js +16 -16
  60. package/components/common/hooks/useIntersectionObserver.js +1 -1
  61. package/components/common/hooks/useKeyboardEvent.js +9 -10
  62. package/components/common/hooks/useOverflowHidden.js +1 -4
  63. package/components/common/hooks/usePersistCallback.js +7 -7
  64. package/components/common/hooks/useStateCallback.js +9 -10
  65. package/components/common/hooks/useWindowSize.js +8 -8
  66. package/components/common/space/index.js +9 -7
  67. package/components/common/utils/convertToDurationBasedOnTimeUnits.js +6 -0
  68. package/components/common/utils/dom.js +27 -29
  69. package/components/common/utils/findScrollParent.js +17 -0
  70. package/components/common/utils/intersectionObserver.js +21 -0
  71. package/components/common/utils/is.js +99 -109
  72. package/components/common/utils/mutationObserver.js +19 -0
  73. package/components/common/utils/reactDOM.js +34 -34
  74. package/components/common/utils/resizeObserver.js +21 -0
  75. package/copy/index.js +38 -40
  76. package/date-picker/Picker.js +290 -295
  77. package/date-picker/RangePicker.js +367 -372
  78. package/date-picker/index.js +33 -35
  79. package/date-picker/panel/Body.js +46 -47
  80. package/date-picker/panel/Header.js +33 -33
  81. package/date-picker/panel/Shortcut.js +31 -31
  82. package/date-picker/panel/date/index.js +85 -85
  83. package/date-picker/panel/month/index.js +59 -59
  84. package/date-picker/panel/quarter/index.js +67 -70
  85. package/date-picker/panel/range/index.js +101 -101
  86. package/date-picker/panel/year/index.js +39 -39
  87. package/date-picker/util.js +17 -18
  88. package/descriptions/index.js +62 -62
  89. package/details/index.js +53 -55
  90. package/development/index.js +9 -9
  91. package/dist/tinycolor/chunk/BOzCVdr0.js +1 -1
  92. package/dist/validate/src/index.js +5 -5
  93. package/dist/validate/src/util.js +1 -1
  94. package/divider/index.js +21 -21
  95. package/draggable/Item.js +35 -35
  96. package/draggable/index.js +22 -22
  97. package/drawer/Drawer.js +142 -147
  98. package/dropdown/Button.js +48 -48
  99. package/dropdown/index.js +88 -92
  100. package/empty/index.js +16 -16
  101. package/form/Control.js +211 -225
  102. package/form/Form.js +109 -113
  103. package/form/FormItem.js +118 -120
  104. package/form/FormList.js +60 -66
  105. package/form/FormProvider.js +31 -34
  106. package/form/hook/useContext.js +17 -19
  107. package/form/hook/useState.js +22 -23
  108. package/form/hook/useWatch.js +26 -27
  109. package/form/promisify.js +14 -18
  110. package/form/store.js +304 -316
  111. package/form/util.js +14 -15
  112. package/grid/Col.js +64 -64
  113. package/grid/Grid.js +51 -51
  114. package/grid/GridItem.js +48 -48
  115. package/grid/Row.js +39 -39
  116. package/hooks/useVerificationCode.js +41 -43
  117. package/hooks/useWatermark.js +89 -92
  118. package/icon/index.js +23 -24
  119. package/icon-hover/index.js +16 -16
  120. package/icons/file.js +11 -11
  121. package/image/Image.js +140 -141
  122. package/image/ImagePreview.js +252 -255
  123. package/image/ImagePreviewArrow.js +25 -25
  124. package/image/ImagePreviewGroup.js +62 -62
  125. package/image/util/getScale.js +25 -28
  126. package/index.js +684 -675
  127. package/input/Button.js +48 -50
  128. package/input/Group.js +9 -9
  129. package/input/Input.js +145 -154
  130. package/input/InputElement.js +108 -115
  131. package/input/Password.js +38 -38
  132. package/input/Search.js +51 -55
  133. package/input/Textarea.js +80 -81
  134. package/input/useComposition.js +23 -23
  135. package/input-number/decimal.js +59 -62
  136. package/input-number/index.js +139 -141
  137. package/input-tag/InputTag.js +222 -230
  138. package/layout/Content.js +6 -6
  139. package/layout/Footer.js +8 -8
  140. package/layout/Header.js +7 -7
  141. package/layout/Sider.js +88 -90
  142. package/layout/index.js +30 -30
  143. package/link/index.js +45 -46
  144. package/liquid-fill/LiquidFill.js +226 -0
  145. package/liquid-fill/LiquidFill2.js +3 -0
  146. package/liquid-fill/index.js +4 -0
  147. package/list/Item.js +28 -28
  148. package/list/Meta.js +12 -12
  149. package/list/index.js +146 -148
  150. package/mentions/index.js +75 -76
  151. package/menu/Item.js +58 -58
  152. package/menu/Menu.js +125 -127
  153. package/menu/OverflowWrap.js +39 -40
  154. package/menu/sub-menu/Inline.js +45 -45
  155. package/menu/util.js +26 -28
  156. package/message/index.js +96 -99
  157. package/message/useMessage.js +26 -27
  158. package/modal/Confirm.js +47 -49
  159. package/modal/Modal.js +250 -257
  160. package/modal/use-modal/Hook.js +26 -28
  161. package/modal/use-modal/index.js +46 -49
  162. package/notice/index.js +89 -90
  163. package/notification/index.js +60 -65
  164. package/notification/withNotification.js +35 -35
  165. package/overflow-ellipsis/OverflowItem.js +19 -20
  166. package/overflow-ellipsis/index.js +45 -46
  167. package/package.json +1 -1
  168. package/page-header/index.js +45 -45
  169. package/pagination/PageItem.js +87 -91
  170. package/pagination/PageJumper.js +40 -41
  171. package/pagination/PageOption.js +31 -35
  172. package/pagination/Pagination.js +162 -163
  173. package/picker/Input.js +90 -96
  174. package/picker/InputRange.js +115 -122
  175. package/popconfirm/index.js +98 -100
  176. package/popover/index.js +28 -28
  177. package/portal/Portal.js +10 -11
  178. package/progress/index.js +36 -36
  179. package/qr-code/index.js +99 -0
  180. package/qr-code/interface.js +1 -0
  181. package/radio/Group.js +48 -48
  182. package/radio/GroupBlock.js +32 -33
  183. package/radio/Radio.js +62 -64
  184. package/rate/index.js +88 -88
  185. package/resize-box/ResizeTrigger.js +39 -39
  186. package/resize-box/Split.js +92 -96
  187. package/resize-box/SplitGroup.js +116 -122
  188. package/resize-box/index.js +112 -115
  189. package/result/index.js +44 -44
  190. package/select/Option.js +53 -56
  191. package/select/Select.js +365 -381
  192. package/select/util.js +95 -99
  193. package/select-view/Core.js +159 -160
  194. package/skeleton/index.js +23 -23
  195. package/slider/Button.js +84 -92
  196. package/slider/Input.js +47 -49
  197. package/slider/Tick.js +28 -31
  198. package/slider/index.js +107 -107
  199. package/space/index.js +26 -26
  200. package/space-/index.js +51 -51
  201. package/spin/DotLoading.js +8 -8
  202. package/spin/index.js +47 -47
  203. package/statistic/Countdown.js +37 -37
  204. package/statistic/index.js +58 -58
  205. package/steps/Step.js +42 -42
  206. package/steps/index.js +54 -54
  207. package/style.css +1 -1
  208. package/switch/index.js +77 -78
  209. package/table/ColGroup.js +36 -37
  210. package/table/Table.js +447 -450
  211. package/table/hook/useExpand.js +24 -24
  212. package/table/hook/useRowSelection.js +62 -62
  213. package/table/summary/Row.js +16 -17
  214. package/table/tbody/Td.js +119 -118
  215. package/table/tbody/Tr.js +119 -121
  216. package/table/tbody/index.js +62 -63
  217. package/table/th-resizable/index.js +30 -30
  218. package/table/thead/Column.js +148 -148
  219. package/table/thead/index.js +87 -88
  220. package/tabs/Tab.js +55 -55
  221. package/tabs/TabContent.js +8 -8
  222. package/tabs/TabPane.js +15 -15
  223. package/tabs/hook/useHeaderScroll.js +36 -36
  224. package/tabs/tab-header/TabInk.js +31 -33
  225. package/tabs/tab-header/TabNavIcon.js +34 -35
  226. package/tabs/tab-header/index.js +192 -195
  227. package/tag/index.js +94 -97
  228. package/time-picker/Picker.js +167 -172
  229. package/time-picker/RangePicker.js +28 -28
  230. package/time-picker/TimePicker.js +146 -146
  231. package/timeline/Item.js +46 -46
  232. package/timeline/Timeline.js +52 -52
  233. package/tooltip/index.js +89 -95
  234. package/tour/index.js +289 -0
  235. package/transfer/Item.js +54 -54
  236. package/transfer/List.js +134 -136
  237. package/transfer/index.js +91 -91
  238. package/tree/Animation.js +49 -52
  239. package/tree/Node.js +114 -122
  240. package/tree/NodeList.js +51 -51
  241. package/tree/Tree.js +386 -393
  242. package/tree-select/List.js +71 -72
  243. package/tree-select/Select.js +135 -143
  244. package/tree-select/hook/useKeyCache.js +39 -39
  245. package/tree-select/hook/useStateValue.js +12 -12
  246. package/trigger/getPopupStyle.js +60 -61
  247. package/trigger/index.js +337 -346
  248. package/types/common/space/interface.d.ts +1 -1
  249. package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
  250. package/types/common/utils/findScrollParent.d.ts +2 -0
  251. package/types/common/utils/index.d.ts +5 -0
  252. package/types/common/utils/intersectionObserver.d.ts +2 -0
  253. package/types/common/utils/mutationObserver.d.ts +2 -0
  254. package/types/common/utils/resizeObserver.d.ts +2 -0
  255. package/types/pc/config-provider/interface.d.ts +6 -0
  256. package/types/pc/index.d.ts +3 -0
  257. package/types/pc/liquid-fill/LiquidFill.d.ts +115 -0
  258. package/types/pc/liquid-fill/LiquidFill2.d.ts +1 -0
  259. package/types/pc/liquid-fill/index.d.ts +2 -0
  260. package/types/pc/qr-code/index.d.ts +34 -0
  261. package/types/pc/qr-code/interface.d.ts +39 -0
  262. package/types/pc/table/interface.d.ts +2 -2
  263. package/types/pc/tour/index.d.ts +42 -0
  264. package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
  265. package/types/pc/utils/findScrollParent.d.ts +2 -0
  266. package/types/pc/utils/index.d.ts +5 -0
  267. package/types/pc/utils/intersectionObserver.d.ts +2 -0
  268. package/types/pc/utils/mutationObserver.d.ts +2 -0
  269. package/types/pc/utils/names.d.ts +18 -0
  270. package/types/pc/utils/resizeObserver.d.ts +2 -0
  271. package/typography/Base.js +79 -81
  272. package/typography/EditContent.js +30 -33
  273. package/typography/Ellipsis.js +77 -73
  274. package/typography/Operations.js +50 -52
  275. package/typography/Paragraph.js +7 -7
  276. package/typography/Typography.js +7 -7
  277. package/typography/useEllipsis.js +105 -106
  278. package/upload/TriggerNode.js +69 -76
  279. package/upload/Upload.js +84 -87
  280. package/upload/Uploader.js +115 -118
  281. package/upload/list/PictureItem.js +61 -71
  282. package/upload/list/TextItem.js +61 -67
  283. package/upload/list/UploadProgress.js +42 -49
  284. package/upload/list/index.js +48 -49
  285. package/upload/request_.js +37 -38
  286. package/upload/util.js +39 -39
  287. package/utils/convertToDurationBasedOnTimeUnits.js +6 -0
  288. package/utils/findScrollParent.js +4 -0
  289. package/utils/index.js +281 -278
  290. package/utils/intersectionObserver.js +4 -0
  291. package/utils/mutationObserver.js +4 -0
  292. package/utils/names.js +12 -0
  293. package/utils/resizeObserver.js +4 -0
  294. package/verification-code/VerificationCode.js +50 -51
  295. package/version/index.js +1 -1
  296. package/virtual-list/VirtualList.js +243 -244
  297. package/virtual-list/util/item.js +3 -4
  298. package/watermark/Watermark.js +27 -31
  299. package/components/common/utils/resizeObserverEffect.js +0 -23
  300. package/types/common/utils/resizeObserverEffect.d.ts +0 -2
  301. package/types/pc/utils/resizeObserverEffect.d.ts +0 -2
  302. package/utils/resizeObserverEffect.js +0 -4
@@ -1,228 +1,217 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import ce from "@unicom-cloud/icons/IconUiCheck";
3
- import de from "@unicom-cloud/icons/IconUiLeft";
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import ue from "@unicom-cloud/icons/IconUiCheck";
3
+ import ce from "@unicom-cloud/icons/IconUiLeft";
4
4
  import pe from "@unicom-cloud/icons/IconUiLoading";
5
- import me from "@unicom-cloud/icons/IconUiRight";
6
- import { isEmptyValue as fe, isEmptyArray as he } from "@unicom-cloud/utils/is";
7
- import ge from "lodash/isArray";
8
- import O from "lodash/isFunction";
9
- import L from "lodash/isPlainObject";
10
- import Ce from "lodash/isString";
11
- import { forwardRef as Ve, useContext as ve, useRef as S, useState as ye, useEffect as $, useImperativeHandle as Se, useCallback as j } from "react";
5
+ import de from "@unicom-cloud/icons/IconUiRight";
6
+ import { isEmptyValue as me, isEmptyArray as fe } from "@unicom-cloud/utils/is";
7
+ import he from "lodash/isArray";
8
+ import k from "lodash/isFunction";
9
+ import x from "lodash/isPlainObject";
10
+ import ge from "lodash/isString";
11
+ import { forwardRef as Ce, useContext as Ve, useRef as y, useState as ve, useEffect as B, useImperativeHandle as ye, useCallback as _ } from "react";
12
12
  import "../config-provider/ConfigProvider.js";
13
- import be from "../components/common/hooks/useForceUpdate.js";
14
- import ke from "../components/common/hooks/useId.js";
15
- import we from "../components/common/hooks/useMergeProps.js";
16
- import z from "../components/common/hooks/useMergeValue.js";
17
- import Oe from "../components/common/hooks/useUpdateEffect.js";
18
- import Ee from "../select-view/index.js";
19
- import Ne from "../trigger/index.js";
20
- import Pe from "@unicom-cloud/utils/class-name";
21
- import { Esc as Ie, Tab as xe, Enter as Me } from "@unicom-cloud/utils/constant/keyboardCode";
22
- import Le from "./hook/useRefCurrent.js";
23
- import Te from "./panel/List.js";
24
- import Re from "./panel/Search.js";
25
- import { SHOW_CHILD as De, getConfig as Fe, getStore as Ae, formatValue as b, transformValuesToSet as Ue, valueInSet as Be, removeValueFromSet as _e, PANEL_MODE as K } from "./util.js";
26
- import He from "../config-provider/context.js";
27
- const We = {
13
+ import Se from "../components/common/hooks/useForceUpdate.js";
14
+ import be from "../components/common/hooks/useId.js";
15
+ import ke from "../components/common/hooks/useMergeProps.js";
16
+ import H from "../components/common/hooks/useMergeValue.js";
17
+ import we from "../components/common/hooks/useUpdateEffect.js";
18
+ import Oe from "../select-view/index.js";
19
+ import Ee from "../trigger/index.js";
20
+ import Ne from "@unicom-cloud/utils/class-name";
21
+ import { Esc as Pe, Tab as xe, Enter as Ie } from "@unicom-cloud/utils/constant/keyboardCode";
22
+ import Me from "./hook/useRefCurrent.js";
23
+ import Le from "./panel/List.js";
24
+ import Te from "./panel/Search.js";
25
+ import { SHOW_CHILD as Re, getConfig as De, getStore as Fe, formatValue as S, transformValuesToSet as Ae, valueInSet as Ue, removeValueFromSet as Be, PANEL_MODE as W } from "./util.js";
26
+ import _e from "../config-provider/context.js";
27
+ const He = {
28
28
  label: "label",
29
29
  value: "value",
30
30
  isLeaf: "isLeaf",
31
31
  children: "children",
32
32
  disabled: "disabled"
33
- }, $e = {
33
+ }, We = {
34
34
  options: [],
35
35
  bordered: !0,
36
- fieldNames: We,
36
+ fieldNames: He,
37
37
  trigger: "click",
38
38
  expandTrigger: "click",
39
- checkedStrategy: De,
39
+ checkedStrategy: Re,
40
40
  defaultActiveFirstOption: !0
41
- }, je = { bottom: 4 };
42
- function ze(J, q) {
43
- const { getPrefixCls: E, renderEmpty: G, componentConfig: N, rtl: v } = ve(He), e = we(
44
- J,
45
- $e,
46
- N == null ? void 0 : N.Cascader
41
+ }, $e = { bottom: 4 };
42
+ function je($, j) {
43
+ const { getPrefixCls: z, renderEmpty: K, componentConfig: J, rtl: V } = Ve(_e), e = ke(
44
+ $,
45
+ We,
46
+ J?.Cascader
47
47
  ), {
48
- disabled: T,
49
- renderFormat: P,
50
- getPopupContainer: Q,
51
- children: R,
52
- triggerProps: X,
53
- expandTrigger: Y,
54
- icons: f
55
- } = e, D = {
56
- loading: (f == null ? void 0 : f.loading) || /* @__PURE__ */ p(pe, {}),
57
- checked: (f == null ? void 0 : f.checked) || /* @__PURE__ */ p(ce, {}),
58
- next: (f == null ? void 0 : f.next) || (v ? /* @__PURE__ */ p(de, {}) : /* @__PURE__ */ p(me, {}))
59
- }, g = E == null ? void 0 : E("cascader"), a = e.mode === "multiple", y = S(null), Z = be(), l = Le(() => Ae(
48
+ disabled: I,
49
+ renderFormat: w,
50
+ getPopupContainer: q,
51
+ children: M,
52
+ triggerProps: G,
53
+ expandTrigger: Q,
54
+ icons: O
55
+ } = e, L = {
56
+ loading: O?.loading || /* @__PURE__ */ c(pe, {}),
57
+ checked: O?.checked || /* @__PURE__ */ c(ue, {}),
58
+ next: O?.next || (V ? /* @__PURE__ */ c(ce, {}) : /* @__PURE__ */ c(de, {}))
59
+ }, h = z?.("cascader"), a = e.mode === "multiple", v = y(null), X = Se(), s = Me(() => Fe(
60
60
  e,
61
- b(
61
+ S(
62
62
  "value" in e ? e.value : e.defaultValue,
63
63
  a
64
64
  )
65
- ), [JSON.stringify(Fe(e)), e.options]), [I, F] = ye(() => "value" in e ? b(e.value, a, l) : "defaultValue" in e ? b(e.defaultValue, a, l) : []), h = "value" in e ? b(e.value, a, l) : I, [u, ee] = z(!1, {
65
+ ), [JSON.stringify(De(e)), e.options]), [E, T] = ve(() => "value" in e ? S(e.value, a, s) : "defaultValue" in e ? S(e.defaultValue, a, s) : []), f = "value" in e ? S(e.value, a, s) : E, [l, Y] = H(!1, {
66
66
  value: e.popupVisible,
67
67
  defaultValue: e.defaultPopupVisible
68
- }), [c, te, ne] = z("", {
68
+ }), [u, Z, ee] = H("", {
69
69
  value: "inputValue" in e ? e.inputValue || "" : void 0
70
- }), k = S(c), A = S(null), C = S(null), x = S((l == null ? void 0 : l.getCheckedNodes()) || []), U = ke(`${g}-popup-`), M = (t, n) => {
71
- var r;
72
- t !== k.current && (te(t), k.current = t, A.current = n, (r = e.onInputValueChange) == null || r.call(e, t, n));
70
+ }), b = y(u), R = y(null), g = y(null), N = y(s?.getCheckedNodes() || []), D = be(`${h}-popup-`), P = (t, n) => {
71
+ t !== b.current && (Z(t), b.current = t, R.current = n, e.onInputValueChange?.(t, n));
73
72
  };
74
- function re(t) {
75
- return fe(t) || he(t);
73
+ function te(t) {
74
+ return me(t) || fe(t);
76
75
  }
77
- $(() => {
78
- var n;
79
- const { current: t } = A;
80
- ne === c && (t === "manual" || t === "optionListHide") && ((n = e.onSearch) == null || n.call(e, c, t)), c !== k.current && (k.current = c);
81
- }, [c]), $(() => {
76
+ B(() => {
77
+ const { current: t } = R;
78
+ ee === u && (t === "manual" || t === "optionListHide") && e.onSearch?.(u, t), u !== b.current && (b.current = u);
79
+ }, [u]), B(() => {
82
80
  const t = () => {
83
- clearTimeout(y.current), y.current = null;
81
+ clearTimeout(v.current), v.current = null;
84
82
  };
85
- return !u && c && (y.current && t(), y.current = setTimeout(() => {
86
- M("", "optionListHide"), y.current = null;
83
+ return !l && u && (v.current && t(), v.current = setTimeout(() => {
84
+ P("", "optionListHide"), v.current = null;
87
85
  }, 200)), () => {
88
86
  t();
89
87
  };
90
- }, [u]), Oe(() => {
91
- if ("value" in e && e.value !== I) {
92
- const t = b(e.value, a);
93
- l.setNodeCheckedByValue(t), F(t);
88
+ }, [l]), we(() => {
89
+ if ("value" in e && e.value !== E) {
90
+ const t = S(e.value, a);
91
+ s.setNodeCheckedByValue(t), T(t);
94
92
  }
95
- }, [e.value, a]), Se(q, () => C.current, []);
96
- const oe = (t) => {
97
- x.current = Array.from(
98
- new Set([].concat(t, x.current))
93
+ }, [e.value, a]), ye(j, () => g.current, []);
94
+ const ne = (t) => {
95
+ N.current = Array.from(
96
+ new Set([].concat(t, N.current))
99
97
  );
100
- }, B = (t) => {
101
- const n = [], r = Ue(t), i = (o) => {
102
- o.some((s) => {
103
- if (Be(r, s.pathValue) && (n.push(s.getPathNodes().map((d) => d._data)), _e(r, s.pathValue)), !r.size)
98
+ }, F = (t) => {
99
+ const n = [], o = Ae(t), i = (r) => {
100
+ r.some((d) => {
101
+ if (Ue(o, d.pathValue) && (n.push(d.getPathNodes().map((m) => m._data)), Be(o, d.pathValue)), !o.size)
104
102
  return !0;
105
103
  });
106
104
  };
107
- return i(l.getCheckedNodes()), r.size && i(x.current), n;
108
- }, m = j(
105
+ return i(s.getCheckedNodes()), o.size && i(N.current), n;
106
+ }, p = _(
109
107
  (t) => {
110
- var n;
111
- t !== u && ((n = e.onVisibleChange) == null || n.call(e, t), "popupVisible" in e || ee(t));
108
+ t !== l && (e.onVisibleChange?.(t), "popupVisible" in e || Y(t));
112
109
  },
113
- [e.onVisibleChange, u]
114
- ), ie = j(
110
+ [e.onVisibleChange, l]
111
+ ), re = _(
115
112
  (t) => {
116
- var o;
117
- const n = B([t])[0] || [];
118
- let r, i = ge(t) ? t.map((s) => String(s)) : [];
119
- return n.length && (i = n.map((s) => s.label)), O(P) ? r = P(i) : i.every((s, d, w) => Ce(s)) ? r = i.join(" / ") : r = i.reduce((s, d, w) => s.concat(w === 0 ? [d] : [" / ", d]), []), {
120
- text: r || "",
121
- disabled: (o = n[n.length - 1]) == null ? void 0 : o.disabled
113
+ const n = F([t])[0] || [];
114
+ let o, i = he(t) ? t.map((r) => String(r)) : [];
115
+ return n.length && (i = n.map((r) => r.label)), k(w) ? o = w(i) : i.every((r, d, m) => ge(r)) ? o = i.join(" / ") : o = i.reduce((r, d, m) => r.concat(m === 0 ? [d] : [" / ", d]), []), {
116
+ text: o || "",
117
+ disabled: n[n.length - 1]?.disabled
122
118
  };
123
119
  },
124
- [l, I, P]
120
+ [s, E, w]
125
121
  // 这里把 stateValue 放到依赖里面,是因为当受控时props.value改变或非受控时内部stateValue改变,都会需要出发节点选中状态的更新
126
122
  // 此时需要重新渲染已选中值的展示
127
- ), V = (t, n) => {
128
- var W;
129
- n === "panel" && L(e.showSearch) && !e.showSearch.retainInputValueWhileSelect && a && M("", "optionChecked");
130
- const { onChange: r, changeOnSelect: i, expandTrigger: o } = e;
131
- if (h === t)
123
+ ), C = (t, n) => {
124
+ n === "panel" && x(e.showSearch) && !e.showSearch.retainInputValueWhileSelect && a && P("", "optionChecked");
125
+ const { onChange: o, changeOnSelect: i, expandTrigger: r } = e;
126
+ if (f === t)
132
127
  return;
133
- a || l.setNodeCheckedByValue(t), oe(l.getCheckedNodes());
134
- const d = B(t), w = a ? t : t[0], ue = a ? d : d[0];
135
- a || (c || d[0] && ((W = d[0][d[0].length - 1]) != null && W.isLeaf) || i && o === "hover") && m(!1), "value" in e ? (l.setNodeCheckedByValue(h), Z()) : F(t), r == null || r(w, ue, {
136
- dropdownVisible: u
128
+ a || s.setNodeCheckedByValue(t), ne(s.getCheckedNodes());
129
+ const m = F(t), se = a ? t : t[0], le = a ? m : m[0];
130
+ a || (u || m[0] && m[0][m[0].length - 1]?.isLeaf || i && r === "hover") && p(!1), "value" in e ? (s.setNodeCheckedByValue(f), X()) : T(t), o?.(se, le, {
131
+ dropdownVisible: l
137
132
  });
138
- }, ae = (t, n, r) => {
139
- if (r.stopPropagation(), t.disabled)
133
+ }, oe = (t, n, o) => {
134
+ if (o.stopPropagation(), t.disabled)
140
135
  return;
141
- const i = h.filter((o, s) => s !== n);
142
- l.setNodeCheckedByValue(i), V(i);
143
- }, _ = (t) => {
144
- const n = t || C.current && C.current.getWidth();
145
- return /* @__PURE__ */ p(
136
+ const i = f.filter((r, d) => d !== n);
137
+ s.setNodeCheckedByValue(i), C(i);
138
+ }, A = (t) => {
139
+ const n = t || g.current && g.current.getWidth();
140
+ return /* @__PURE__ */ c(
146
141
  "div",
147
142
  {
148
- className: `${g}-list-empty`,
143
+ className: `${h}-list-empty`,
149
144
  style: { width: n },
150
- children: e.notFoundContent || G("Cascader")
145
+ children: e.notFoundContent || K("Cascader")
151
146
  }
152
147
  );
153
- }, le = () => {
154
- const t = L(e.showSearch) ? e.showSearch.panelMode : void 0, n = t === K.select ? !0 : t === K.cascader ? !1 : !O(e.onSearch) && !!c, r = C.current && C.current.getWidth(), i = O(e.dropdownRender) ? e.dropdownRender : (o) => o;
155
- return /* @__PURE__ */ p(
148
+ }, ie = () => {
149
+ const t = x(e.showSearch) ? e.showSearch.panelMode : void 0, n = t === W.select ? !0 : t === W.cascader ? !1 : !k(e.onSearch) && !!u, o = g.current && g.current.getWidth(), i = k(e.dropdownRender) ? e.dropdownRender : (r) => r;
150
+ return /* @__PURE__ */ c(
156
151
  "div",
157
152
  {
158
- id: U,
159
- className: Pe(`${g}-popup`, e.dropdownMenuClassName, {
160
- [`${g}-popup-trigger-hover`]: e.expandTrigger === "hover"
153
+ id: D,
154
+ className: Ne(`${h}-popup`, e.dropdownMenuClassName, {
155
+ [`${h}-popup-trigger-hover`]: e.expandTrigger === "hover"
161
156
  }),
162
157
  children: i(
163
- /* @__PURE__ */ p(
158
+ /* @__PURE__ */ c(
164
159
  "div",
165
160
  {
166
- className: `${g}-popup-inner`,
167
- onMouseDown: (o) => o.preventDefault(),
168
- children: n ? /* @__PURE__ */ p(
169
- Re,
161
+ className: `${h}-popup-inner`,
162
+ onMouseDown: (r) => r.preventDefault(),
163
+ children: n ? /* @__PURE__ */ c(
164
+ Te,
170
165
  {
171
- style: { minWidth: r },
172
- store: l,
173
- inputValue: c,
174
- renderEmpty: () => _(r),
166
+ style: { minWidth: o },
167
+ store: s,
168
+ inputValue: u,
169
+ renderEmpty: () => A(o),
175
170
  multiple: a,
176
- onChange: (o) => {
177
- V(o, "panel");
171
+ onChange: (r) => {
172
+ C(r, "panel");
178
173
  },
179
- prefixCls: g,
180
- rtl: v,
174
+ prefixCls: h,
175
+ rtl: V,
181
176
  onEsc: () => {
182
- m(!1);
183
- },
184
- renderOption: L(e.showSearch) && e.showSearch.renderOption || void 0,
185
- getTriggerElement: () => {
186
- var o;
187
- return (o = C.current) == null ? void 0 : o.dom;
177
+ p(!1);
188
178
  },
189
- value: h,
179
+ renderOption: x(e.showSearch) && e.showSearch.renderOption || void 0,
180
+ getTriggerElement: () => g.current?.dom,
181
+ value: f,
190
182
  virtualListProps: e.virtualListProps,
191
183
  defaultActiveFirstOption: e.defaultActiveFirstOption,
192
- icons: D
184
+ icons: L
193
185
  }
194
- ) : /* @__PURE__ */ p(
195
- Te,
186
+ ) : /* @__PURE__ */ c(
187
+ Le,
196
188
  {
197
189
  dropdownMenuColumnStyle: e.dropdownMenuColumnStyle,
198
190
  virtualListProps: e.virtualListProps,
199
- expandTrigger: Y,
200
- store: l,
191
+ expandTrigger: Q,
192
+ store: s,
201
193
  dropdownColumnRender: e.dropdownColumnRender,
202
194
  renderOption: e.renderOption,
203
195
  changeOnSelect: e.changeOnSelect,
204
196
  showEmptyChildren: e.showEmptyChildren || !!e.loadMore,
205
197
  multiple: a,
206
- onChange: (o) => {
207
- V(o, "panel");
198
+ onChange: (r) => {
199
+ C(r, "panel");
208
200
  },
209
201
  loadMore: e.loadMore,
210
- prefixCls: g,
211
- rtl: v,
212
- getTriggerElement: () => {
213
- var o;
214
- return (o = C.current) == null ? void 0 : o.dom;
215
- },
216
- renderEmpty: _,
217
- popupVisible: u,
218
- value: h,
202
+ prefixCls: h,
203
+ rtl: V,
204
+ getTriggerElement: () => g.current?.dom,
205
+ renderEmpty: A,
206
+ popupVisible: l,
207
+ value: f,
219
208
  renderFooter: e.renderFooter,
220
- icons: D,
209
+ icons: L,
221
210
  onEsc: () => {
222
- m(!1);
211
+ p(!1);
223
212
  },
224
213
  onDoubleClickOption: () => {
225
- e.changeOnSelect && !a && m(!1);
214
+ e.changeOnSelect && !a && p(!1);
226
215
  }
227
216
  }
228
217
  )
@@ -231,71 +220,69 @@ function ze(J, q) {
231
220
  )
232
221
  }
233
222
  );
234
- }, se = (t) => {
235
- V(t);
236
- }, H = (t) => /* @__PURE__ */ p(
237
- Ne,
223
+ }, ae = (t) => {
224
+ C(t);
225
+ }, U = (t) => /* @__PURE__ */ c(
226
+ Ee,
238
227
  {
239
- popup: le,
228
+ popup: ie,
240
229
  trigger: e.trigger,
241
- disabled: T,
242
- getPopupContainer: Q,
243
- position: v ? "br" : "bl",
230
+ disabled: I,
231
+ getPopupContainer: q,
232
+ position: V ? "br" : "bl",
244
233
  classNames: "slideDynamicOrigin",
245
- popupAlign: je,
246
- unmountOnExit: "unmountOnExit" in e ? e.unmountOnExit : !O(e.loadMore),
247
- popupVisible: u,
248
- ...X,
249
- onVisibleChange: m,
234
+ popupAlign: $e,
235
+ unmountOnExit: "unmountOnExit" in e ? e.unmountOnExit : !k(e.loadMore),
236
+ popupVisible: l,
237
+ ...G,
238
+ onVisibleChange: p,
250
239
  children: t
251
240
  }
252
241
  );
253
- return R ? H(R) : /* @__PURE__ */ p(
254
- Ee,
242
+ return M ? U(M) : /* @__PURE__ */ c(
243
+ Oe,
255
244
  {
256
245
  ...e,
257
- ref: C,
258
- ariaControls: U,
259
- popupVisible: u,
260
- value: a ? h : h && h[0],
261
- inputValue: c,
262
- rtl: v,
263
- isEmptyValue: re(h),
264
- prefixCls: g,
246
+ ref: g,
247
+ ariaControls: D,
248
+ popupVisible: l,
249
+ value: a ? f : f && f[0],
250
+ inputValue: u,
251
+ rtl: V,
252
+ isEmptyValue: te(f),
253
+ prefixCls: h,
265
254
  isMultiple: a,
266
- renderText: ie,
267
- onRemoveCheckedItem: ae,
268
- onSort: se,
269
- renderView: H,
255
+ renderText: re,
256
+ onRemoveCheckedItem: oe,
257
+ onSort: ae,
258
+ renderView: U,
270
259
  onClear: (t) => {
271
- var n;
272
260
  if (t.stopPropagation(), !a)
273
- V([]);
261
+ C([]);
274
262
  else {
275
- const i = l.getCheckedNodes().filter((o) => o.disabled).map((o) => o.pathValue);
276
- l.setNodeCheckedByValue(i), V(i);
263
+ const o = s.getCheckedNodes().filter((i) => i.disabled).map((i) => i.pathValue);
264
+ s.setNodeCheckedByValue(o), C(o);
277
265
  }
278
- (n = e.onClear) == null || n.call(e, !!u);
266
+ e.onClear?.(!!l);
279
267
  },
280
268
  onKeyDown: (t) => {
281
- var r;
282
- if (T)
269
+ if (I)
283
270
  return;
284
271
  t.stopPropagation();
285
272
  const n = t.key;
286
- u ? (n === Ie.key && (m(!1), t.preventDefault()), n === xe.key && m(!1)) : n === Me.key && (m(!0), t.preventDefault()), (r = e.onKeyDown) == null || r.call(e, t);
273
+ l ? (n === Pe.key && (p(!1), t.preventDefault()), n === xe.key && p(!1)) : n === Ie.key && (p(!0), t.preventDefault()), e.onKeyDown?.(t);
287
274
  },
288
275
  onChangeInputValue: (t) => {
289
- M(t, "manual"), u || m(!0);
276
+ P(t, "manual"), l || p(!0);
290
277
  }
291
278
  }
292
279
  );
293
280
  }
294
- const Ke = Ve(
295
- ze
281
+ const ze = Ce(
282
+ je
296
283
  );
297
- Ke.displayName = "Cascader";
284
+ ze.displayName = "Cascader";
298
285
  export {
299
- We as DefaultFieldNames,
300
- Ke as default
286
+ He as DefaultFieldNames,
287
+ ze as default
301
288
  };