@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
@@ -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
  };