@unicom-cloud/ui 0.8.44 → 0.8.46

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 (489) hide show
  1. package/Affix.js +54 -51
  2. package/Alert.js +46 -43
  3. package/Anchor.js +5 -4
  4. package/AutoComplete.js +60 -55
  5. package/Avatar.js +10 -155
  6. package/BackTop.js +41 -38
  7. package/Badge.js +63 -93
  8. package/Breadcrumb.js +63 -118
  9. package/Button.js +105 -109
  10. package/Calendar.js +139 -536
  11. package/Card.js +65 -101
  12. package/Carousel.js +169 -270
  13. package/Cascader.js +9 -8
  14. package/Checkbox.js +4 -3
  15. package/Collapse.js +4 -3
  16. package/ColorPicker.js +95 -546
  17. package/Comment.js +14 -12
  18. package/ConfigProvider.js +6 -5
  19. package/Copy.js +33 -31
  20. package/DatePicker.js +35 -1993
  21. package/Descriptions.js +30 -28
  22. package/Divider.js +8 -6
  23. package/Draggable.js +28 -85
  24. package/Drawer.js +5 -4
  25. package/Dropdown.js +107 -167
  26. package/Empty.js +28 -8
  27. package/Form.js +30 -1418
  28. package/Grid.js +13 -250
  29. package/Icon.js +19 -45
  30. package/IconHover.js +39 -6
  31. package/Image.js +3 -3
  32. package/Input.js +4 -4
  33. package/InputNumber.js +213 -17
  34. package/InputTag.js +5 -4
  35. package/Layout.js +35 -48
  36. package/Link.js +16 -14
  37. package/List.js +191 -228
  38. package/Loading.js +18 -17
  39. package/Mentions.js +99 -115
  40. package/Menu.js +8 -7
  41. package/Message.js +147 -10
  42. package/Modal.js +5 -4
  43. package/Notice.js +196 -13
  44. package/Notification.js +136 -11
  45. package/NotificationBase.js +5 -4
  46. package/OverflowEllipsis.js +48 -71
  47. package/PageHeader.js +52 -52
  48. package/Pagination.js +12 -11
  49. package/Picker.js +6 -4
  50. package/Popconfirm.js +47 -44
  51. package/Popover.js +25 -23
  52. package/Portal.js +12 -32
  53. package/Progress.js +65 -328
  54. package/Radio.js +6 -5
  55. package/Rate.js +48 -45
  56. package/ResizeBox.js +127 -505
  57. package/Result.js +60 -1417
  58. package/Select.js +9 -8
  59. package/SelectView.js +49 -328
  60. package/Skeleton.js +41 -78
  61. package/Slider.js +228 -702
  62. package/Space.js +53 -57
  63. package/Spin.js +57 -72
  64. package/Statistic.js +84 -153
  65. package/Steps.js +64 -123
  66. package/SuspenseFallbackTest.js +4 -3
  67. package/Switch.js +41 -38
  68. package/Table.js +20 -1999
  69. package/Tabs.js +9 -8
  70. package/Tag.js +24 -21
  71. package/TimePicker.js +19 -272
  72. package/Timeline.js +4 -3
  73. package/Tooltip.js +79 -72
  74. package/Transfer.js +138 -402
  75. package/Tree.js +5 -4
  76. package/TreeSelect.js +8 -7
  77. package/Trigger.js +407 -571
  78. package/Typography.js +11 -722
  79. package/Upload.js +9 -8
  80. package/VerificationCode.js +6 -5
  81. package/Version.js +1 -1
  82. package/VirtualList.js +4 -3
  83. package/Watermark.js +3 -2
  84. package/anchor/Anchor.js +193 -0
  85. package/anchor/Link.js +54 -0
  86. package/anchor/context.js +14 -0
  87. package/anchor/util.js +41 -0
  88. package/avatar/Avatar.js +85 -0
  89. package/avatar/Group.js +84 -0
  90. package/avatar/context.js +5 -0
  91. package/badge/Count.js +35 -0
  92. package/breadcrumb/Item.js +67 -0
  93. package/button/Group.js +15 -0
  94. package/calendar/Month.js +142 -0
  95. package/calendar/WeekList.js +24 -0
  96. package/calendar/Year.js +75 -0
  97. package/calendar/header/Panel.js +57 -0
  98. package/calendar/header/index.js +118 -0
  99. package/calendar/hook/useCellClassName.js +41 -0
  100. package/card/Grid.js +27 -0
  101. package/card/Meta.js +32 -0
  102. package/carousel/Arrow.js +57 -0
  103. package/carousel/Indicator.js +68 -0
  104. package/cascader/Cascader.js +300 -0
  105. package/cascader/base/node.js +142 -0
  106. package/cascader/base/store.js +93 -0
  107. package/cascader/hook/useRefCurrent.js +12 -0
  108. package/cascader/panel/List.js +275 -0
  109. package/cascader/panel/Option.js +35 -0
  110. package/cascader/panel/Search.js +171 -0
  111. package/cascader/util.js +66 -0
  112. package/checkbox/Checkbox.js +111 -0
  113. package/checkbox/Group.js +97 -0
  114. package/checkbox/useCheckbox.js +45 -0
  115. package/collapse/Collapse.js +90 -0
  116. package/collapse/Item.js +165 -0
  117. package/color-picker/ControlBar.js +64 -0
  118. package/color-picker/InputAlpha.js +24 -0
  119. package/color-picker/InputHex.js +59 -0
  120. package/color-picker/InputRgb.js +66 -0
  121. package/color-picker/Palette.js +36 -0
  122. package/color-picker/Panel.js +165 -0
  123. package/color-picker/colors.js +37 -0
  124. package/color-picker/hooks/useColorPicker.js +63 -0
  125. package/color-picker/hooks/useControlBlock.js +40 -0
  126. package/config-provider/ConfigProvider.js +94 -0
  127. package/config-provider/context.js +24 -0
  128. package/date-picker/Picker.js +399 -0
  129. package/date-picker/PickerRange.js +568 -0
  130. package/date-picker/context.js +5 -0
  131. package/date-picker/hook/useCellClassName.js +58 -0
  132. package/date-picker/panel/Body.js +78 -0
  133. package/date-picker/panel/Footer.js +71 -0
  134. package/date-picker/panel/Header.js +74 -0
  135. package/date-picker/panel/Shortcut.js +45 -0
  136. package/date-picker/panel/WeekList.js +19 -0
  137. package/date-picker/panel/date/index.js +194 -0
  138. package/date-picker/panel/month/index.js +113 -0
  139. package/date-picker/panel/quarter/index.js +93 -0
  140. package/date-picker/panel/range/index.js +251 -0
  141. package/date-picker/panel/week/index.js +35 -0
  142. package/date-picker/panel/year/index.js +74 -0
  143. package/date-picker/util.js +69 -0
  144. package/draggable/Item.js +66 -0
  145. package/drawer/Drawer.js +226 -0
  146. package/dropdown/Button.js +91 -0
  147. package/form/Control.js +264 -0
  148. package/form/Form.js +156 -0
  149. package/form/FormItem.js +241 -0
  150. package/form/FormLabel.js +54 -0
  151. package/form/FormList.js +96 -0
  152. package/form/FormProvider.js +48 -0
  153. package/form/IconSymbol.js +20 -0
  154. package/form/context.js +43 -0
  155. package/form/hook/useContext.js +32 -0
  156. package/form/hook/useState.js +31 -0
  157. package/form/hook/useWatch.js +36 -0
  158. package/form/interface.js +11 -0
  159. package/form/promisify.js +23 -0
  160. package/form/store.js +354 -0
  161. package/form/useForm.js +53 -0
  162. package/form/util.js +72 -0
  163. package/grid/Col.js +87 -0
  164. package/grid/Row.js +88 -0
  165. package/grid/context.js +9 -0
  166. package/grid/grid-item.js +77 -0
  167. package/grid/grid.js +104 -0
  168. package/grid/hook/useResponsiveState.js +38 -0
  169. package/grid/util.js +51 -0
  170. package/{chunk/I4RV9SKZ.js → hooks/factory/createHTMLMediaHook.js} +35 -43
  171. package/hooks/index.js +246 -4
  172. package/{chunk/BdYAMaw9.js → hooks/misc/hookState.js} +1 -1
  173. package/hooks/misc/parseTimeRanges.js +12 -0
  174. package/{chunk/TXCrI0jN.js → hooks/misc/util.js} +6 -6
  175. package/hooks/use-watermark/utils.js +8 -0
  176. package/hooks/use-watermark.js +71 -76
  177. package/hooks/useAudio.js +3 -3
  178. package/hooks/useBeforeUnload.js +2 -2
  179. package/hooks/useClickAway.js +10 -10
  180. package/hooks/useCounter.js +1 -1
  181. package/hooks/useCreation.js +2 -4
  182. package/hooks/useDrop.js +12 -12
  183. package/hooks/useDropArea.js +5 -5
  184. package/hooks/useEvent.js +6 -6
  185. package/hooks/useEventListener.js +2 -4
  186. package/hooks/useFavicon.js +1 -2
  187. package/hooks/useFullscreen.js +11 -13
  188. package/hooks/useGetSet.js +5 -5
  189. package/hooks/useHash.js +6 -6
  190. package/hooks/useHover.js +6 -6
  191. package/hooks/useHoverDirty.js +7 -7
  192. package/hooks/useIdle.js +17 -17
  193. package/hooks/useIsomorphicLayoutEffect2.js +3 -3
  194. package/hooks/useKey.js +5 -5
  195. package/hooks/useList.js +1 -1
  196. package/hooks/useLocalStorage.js +2 -3
  197. package/hooks/useLocation.js +1 -1
  198. package/hooks/useLockBodyScroll.js +13 -14
  199. package/hooks/useLongPress.js +7 -7
  200. package/hooks/useMeasure.js +3 -3
  201. package/hooks/useMedia.js +4 -4
  202. package/hooks/useMediaDevices.js +10 -10
  203. package/hooks/useMotion.js +11 -11
  204. package/hooks/useMouse.js +9 -9
  205. package/hooks/useMouseWheel.js +7 -7
  206. package/hooks/useNetworkState.js +7 -7
  207. package/hooks/useOrientation.js +10 -11
  208. package/hooks/useOverrideRef.js +14 -0
  209. package/hooks/usePageLeave.js +4 -4
  210. package/hooks/usePermission.js +9 -9
  211. package/hooks/usePersistCallback.js +15 -0
  212. package/hooks/useScroll.js +6 -6
  213. package/hooks/useScrolling.js +7 -7
  214. package/hooks/useSearchParam.js +5 -5
  215. package/hooks/useSessionStorage.js +9 -9
  216. package/hooks/useSize.js +1 -1
  217. package/hooks/useSlider.js +6 -6
  218. package/hooks/useStartTyping.js +4 -4
  219. package/hooks/useStateList.js +4 -5
  220. package/hooks/useStateWithHistory.js +1 -1
  221. package/hooks/useTimeout.js +1 -2
  222. package/hooks/useVibrate.js +5 -5
  223. package/hooks/useVideo.js +3 -3
  224. package/hooks/useWindowScroll.js +13 -13
  225. package/hooks/useWindowSize.js +6 -6
  226. package/icon/addFromIconFontCn.js +33 -0
  227. package/image/Image.js +189 -0
  228. package/image/ImageFooter.js +45 -0
  229. package/image/ImagePreview.js +473 -0
  230. package/image/ImagePreviewArrow.js +40 -0
  231. package/image/ImagePreviewGroup.js +125 -0
  232. package/image/ImagePreviewToolbar.js +98 -0
  233. package/image/TriggerForToolbar.js +10 -0
  234. package/image/previewGroupContext.js +17 -0
  235. package/image/util/getFixTranslate.js +7 -0
  236. package/image/util/getScale.js +72 -0
  237. package/image/util/hook/useImageStatus.js +16 -0
  238. package/image/util/hook/useShowFooter.js +7 -0
  239. package/index.js +440 -398
  240. package/input/Group.js +20 -0
  241. package/input/Input.js +185 -0
  242. package/input/InputElement.js +233 -0
  243. package/input/Number.js +4 -0
  244. package/input/Password.js +72 -0
  245. package/input/Search.js +80 -0
  246. package/input/Tag.js +7 -0
  247. package/input/Textarea.js +168 -0
  248. package/input/autoSizeTextAreaHeight.js +65 -0
  249. package/input/useComposition.js +39 -0
  250. package/input-number/decimal.js +154 -0
  251. package/input-number/useSelectionRange.js +26 -0
  252. package/input-number/util.js +57 -0
  253. package/input-tag/InputTag.js +381 -0
  254. package/layout/Content.js +15 -0
  255. package/layout/Footer.js +15 -0
  256. package/layout/Header.js +15 -0
  257. package/{chunk/B9asjXwm.js → layout/Sider.js} +23 -22
  258. package/list/Item.js +46 -0
  259. package/list/Meta.js +21 -0
  260. package/loading/style/index.module.less.js +4 -0
  261. package/mentions/util.js +26 -0
  262. package/menu/Indent.js +17 -0
  263. package/menu/Item.js +125 -0
  264. package/menu/ItemGroup.js +39 -0
  265. package/menu/Menu.js +181 -0
  266. package/menu/OverflowWrap.js +85 -0
  267. package/menu/context.js +5 -0
  268. package/menu/sub-menu/Inline.js +111 -0
  269. package/menu/sub-menu/Pop.js +126 -0
  270. package/menu/sub-menu/index.js +17 -0
  271. package/menu/util.js +80 -0
  272. package/message/useMessage.js +53 -0
  273. package/modal/Confirm.js +98 -0
  274. package/modal/Modal.js +419 -0
  275. package/modal/config.js +25 -0
  276. package/modal/use-modal/Hook.js +55 -0
  277. package/modal/use-modal/index.js +68 -0
  278. package/notification/useNotification.js +55 -0
  279. package/overflow-ellipsis/OverflowItem.js +34 -0
  280. package/package.json +1 -1
  281. package/pagination/PageItem.js +121 -0
  282. package/pagination/PageJumper.js +64 -0
  283. package/pagination/PageOption.js +55 -0
  284. package/pagination/Pagination.js +245 -0
  285. package/picker/Input.js +124 -0
  286. package/picker/InputRange.js +155 -0
  287. package/portal/Portal.js +25 -0
  288. package/progress/CircleProgress.js +117 -0
  289. package/progress/LineProgess.js +103 -0
  290. package/progress/StepProgress.js +74 -0
  291. package/radio/Group.js +91 -0
  292. package/radio/Radio.js +90 -0
  293. package/resize-box/ResizeTrigger.js +78 -0
  294. package/resize-box/Split.js +132 -0
  295. package/resize-box/SplitGroup.js +204 -0
  296. package/result/403.js +695 -0
  297. package/result/404.js +513 -0
  298. package/result/500.js +166 -0
  299. package/select/OptGroup.js +20 -0
  300. package/select/Option.js +97 -0
  301. package/select/Select.js +544 -0
  302. package/select/util.js +140 -0
  303. package/select-view/Core.js +309 -0
  304. package/skeleton/Image.js +24 -0
  305. package/skeleton/Text.js +27 -0
  306. package/slider/Button.js +159 -0
  307. package/slider/Dot.js +43 -0
  308. package/slider/Input.js +75 -0
  309. package/slider/Mark.js +28 -0
  310. package/slider/Tick.js +44 -0
  311. package/slider/hook/useInterval.js +73 -0
  312. package/slider/hook/useLegalValue.js +70 -0
  313. package/slider/util.js +63 -0
  314. package/space/toArray.js +11 -0
  315. package/spin/DotLoading.js +26 -0
  316. package/statistic/Countdown.js +57 -0
  317. package/statistic/util.js +33 -0
  318. package/steps/Step.js +68 -0
  319. package/style.css +1 -1
  320. package/table/ColGroup.js +59 -0
  321. package/table/Table.js +634 -0
  322. package/table/constant.js +5 -0
  323. package/table/hook/useColumns.js +141 -0
  324. package/table/hook/useComponent.js +64 -0
  325. package/table/hook/useExpand.js +36 -0
  326. package/table/hook/useRowSelection.js +92 -0
  327. package/table/hook/useSorter.js +54 -0
  328. package/table/hook/useStickyClassNames.js +30 -0
  329. package/table/hook/useStickyOffsets.js +30 -0
  330. package/table/summary/Cell.js +10 -0
  331. package/table/summary/Row.js +26 -0
  332. package/table/summary/context.js +5 -0
  333. package/table/summary/index.js +10 -0
  334. package/table/tbody/Td.js +168 -0
  335. package/table/tbody/Tr.js +168 -0
  336. package/table/tbody/index.js +156 -0
  337. package/table/tfoot/index.js +16 -0
  338. package/table/thead/Column.js +250 -0
  339. package/table/thead/index.js +131 -0
  340. package/table/util.js +121 -0
  341. package/tabs/Tab.js +170 -0
  342. package/tabs/TabContent.js +54 -0
  343. package/tabs/TabPane.js +26 -0
  344. package/tabs/hook/useDomSize.js +17 -0
  345. package/tabs/hook/useHeaderScroll.js +64 -0
  346. package/tabs/tab-header/DropdownIcon.js +71 -0
  347. package/tabs/tab-header/TabInk.js +65 -0
  348. package/tabs/tab-header/TabNavIcon.js +65 -0
  349. package/tabs/tab-header/TabTitle.js +78 -0
  350. package/tabs/tab-header/index.js +335 -0
  351. package/tabs/util.js +22 -0
  352. package/time-picker/Picker.js +221 -0
  353. package/time-picker/RangePicker.js +56 -0
  354. package/time-picker/TimeColumn.js +65 -0
  355. package/time-picker/TimePicker.js +242 -0
  356. package/time-picker/context.js +5 -0
  357. package/time-picker/util.js +43 -0
  358. package/timeline/Item.js +94 -0
  359. package/timeline/Timeline.js +80 -0
  360. package/transfer/Item.js +107 -0
  361. package/transfer/List.js +192 -0
  362. package/tree/Animation.js +104 -0
  363. package/tree/Context.js +5 -0
  364. package/tree/Node.js +215 -0
  365. package/tree/NodeList.js +84 -0
  366. package/tree/Tree.js +549 -0
  367. package/tree/util.js +76 -0
  368. package/tree-select/List.js +127 -0
  369. package/tree-select/Select.js +260 -0
  370. package/tree-select/hook/useKeyCache.js +56 -0
  371. package/tree-select/hook/useStateValue.js +98 -0
  372. package/tree-select/hook/useTreeData.js +13 -0
  373. package/tree-select/interface.js +13 -0
  374. package/tree-select/util.js +9 -0
  375. package/trigger/Portal.js +14 -0
  376. package/trigger/getPopupStyle.js +190 -0
  377. package/types/badge/Count.d.ts +2 -1
  378. package/types/badge/index.d.ts +2 -2
  379. package/types/button/index.d.ts +2 -2
  380. package/types/carousel/index.d.ts +1 -1
  381. package/types/color-picker/colors.d.ts +1 -1
  382. package/types/color-picker/style/index.d.ts +1 -1
  383. package/types/drawer/Drawer.d.ts +1 -1
  384. package/types/dropdown/interface.d.ts +1 -0
  385. package/types/hooks/index.d.ts +122 -0
  386. package/types/hooks/use-verification-code/interface.d.ts +1 -1
  387. package/types/hooks/useAsync.d.ts +1 -1
  388. package/types/hooks/useDropArea.d.ts +1 -0
  389. package/types/hooks/useOverrideRef.d.ts +5 -0
  390. package/types/hooks/usePersistCallback.d.ts +1 -0
  391. package/types/hooks/useUpsert.d.ts +1 -1
  392. package/types/icon-hover/index.d.ts +5 -3
  393. package/types/index.d.ts +2 -120
  394. package/types/input-tag/InputTag.d.ts +1 -1
  395. package/types/link/interface.d.ts +1 -1
  396. package/types/list/index.d.ts +1 -1
  397. package/types/modal/interface.d.ts +1 -0
  398. package/types/notice/index.d.ts +3 -0
  399. package/types/notification/index.d.ts +1 -1
  400. package/types/page-header/index.d.ts +1 -1
  401. package/types/select/Select.d.ts +1 -1
  402. package/types/select-view/Core.d.ts +3 -2
  403. package/types/select-view/index.d.ts +1 -0
  404. package/types/statistic/index.d.ts +1 -1
  405. package/types/switch/index.d.ts +1 -1
  406. package/types/switch/interface.d.ts +1 -1
  407. package/types/table/interface.d.ts +2 -1
  408. package/types/tooltip/index.d.ts +1 -1
  409. package/types/trigger/index.d.ts +12 -8
  410. package/types/trigger/interface.d.ts +1 -0
  411. package/types/typography/Base.d.ts +8 -7
  412. package/types/typography/EditContent.d.ts +3 -2
  413. package/types/typography/Paragraph.d.ts +2 -5
  414. package/types/typography/Text.d.ts +1 -5
  415. package/types/typography/Title.d.ts +2 -5
  416. package/types/upload/TriggerNode.d.ts +5 -3
  417. package/types/upload/list/PictureItem.d.ts +3 -3
  418. package/types/upload/list/TextItem.d.ts +3 -3
  419. package/types/utils/CSSTransition.d.ts +2 -0
  420. package/types/utils/constant.d.ts +1 -1
  421. package/types/utils/is.d.ts +4 -0
  422. package/types/utils/reactDOM.d.ts +3 -1
  423. package/types/utils/warning.d.ts +1 -1
  424. package/types/version/index.d.ts +1 -1
  425. package/typography/Base.js +184 -0
  426. package/typography/EditContent.js +49 -0
  427. package/typography/Ellipsis.js +293 -0
  428. package/typography/Operations.js +78 -0
  429. package/typography/Paragraph.js +26 -0
  430. package/typography/Text.js +11 -0
  431. package/typography/Title.js +12 -0
  432. package/typography/Typography.js +15 -0
  433. package/typography/useCssEllipsis.js +37 -0
  434. package/typography/useEllipsis.js +150 -0
  435. package/upload/TriggerNode.js +118 -0
  436. package/upload/Upload.js +205 -0
  437. package/upload/Uploader.js +205 -0
  438. package/upload/interface.js +9 -0
  439. package/upload/list/PictureItem.js +91 -0
  440. package/upload/list/TextItem.js +99 -0
  441. package/upload/list/UploadProgress.js +97 -0
  442. package/upload/list/index.js +120 -0
  443. package/upload/request.js +51 -0
  444. package/upload/util.js +61 -0
  445. package/utils/CSSTransition.js +27 -0
  446. package/utils/contextHolder.js +29 -4
  447. package/utils/getHighlightText.js +1 -2
  448. package/utils/is.js +81 -68
  449. package/utils/reactDOM.js +33 -22
  450. package/utils/style.js +1 -2
  451. package/utils/warning.js +7 -3
  452. package/verification-code/VerificationCode.js +83 -0
  453. package/virtual-list/Filler.js +31 -0
  454. package/virtual-list/VirtualList.js +378 -0
  455. package/virtual-list/util/algorithm.js +32 -0
  456. package/virtual-list/util/item.js +99 -0
  457. package/{chunk/BCEX3Acw.js → watermark/Watermark.js} +13 -11
  458. package/chunk/B1P8u7kB.js +0 -798
  459. package/chunk/B2ufZjjd.js +0 -1000
  460. package/chunk/B7QOJqps.js +0 -162
  461. package/chunk/BBz3S3zo.js +0 -966
  462. package/chunk/BGzBxiWE.js +0 -517
  463. package/chunk/BNRfcEHj.js +0 -984
  464. package/chunk/BSs6uXmc.js +0 -946
  465. package/chunk/BTjUAV8T.js +0 -277
  466. package/chunk/BYQeEcKe.js +0 -375
  467. package/chunk/Ba4UXIST.js +0 -605
  468. package/chunk/BfaXVcik.js +0 -271
  469. package/chunk/Bs11tCU6.js +0 -240
  470. package/chunk/C7FC7dzS.js +0 -516
  471. package/chunk/CLzbve11.js +0 -694
  472. package/chunk/CN4zXU4b.js +0 -877
  473. package/chunk/CYTPZUHD.js +0 -769
  474. package/chunk/CcCo_dK0.js +0 -335
  475. package/chunk/CoCXcpQd.js +0 -261
  476. package/chunk/D4yH4UKK.js +0 -80
  477. package/chunk/DiSLYN2-.js +0 -167
  478. package/chunk/Dr0iXIXO.js +0 -736
  479. package/chunk/G3-2uJao.js +0 -229
  480. package/chunk/RnTpOC5-.js +0 -1
  481. package/chunk/Z-mtdHUQ.js +0 -226
  482. package/chunk/ZISxNnaR.js +0 -165
  483. package/chunk/aPJXnDSb.js +0 -450
  484. package/chunk/i605JRmI.js +0 -232
  485. package/chunk/l0sNRNKZ.js +0 -1
  486. package/types/form/FormItemTip.d.ts +0 -8
  487. /package/{chunk/C6Kfwj0f.js → loading/style/index.less.js} +0 -0
  488. /package/{chunk/DP2rzg_V.js → suspense-fallback-test/style/index.less.js} +0 -0
  489. /package/{chunk/K6Dvbx-E.js → virtual-list/style/index.less.js} +0 -0
package/chunk/B2ufZjjd.js DELETED
@@ -1,1000 +0,0 @@
1
- var Re = Object.defineProperty;
2
- var Fe = (t, e, n) => e in t ? Re(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var d = (t, e, n) => (Fe(t, typeof e != "symbol" ? e + "" : e, n), n);
4
- import { jsxs as te, Fragment as ne, jsx as g } from "react/jsx-runtime";
5
- import He from "@unicom-cloud/icons/IconUiCheck";
6
- import Be from "@unicom-cloud/icons/IconUiLeft";
7
- import je from "@unicom-cloud/icons/IconUiLoading";
8
- import Ue from "@unicom-cloud/icons/IconUiRight";
9
- import { isEmptyValue as We, isEmptyArray as Ke } from "@unicom-cloud/utils/is";
10
- import Se from "lodash/isArray";
11
- import W from "lodash/isFunction";
12
- import ee from "lodash/isPlainObject";
13
- import X from "lodash/isString";
14
- import ze, { useRef as z, useState as le, useCallback as se, useEffect as Y, forwardRef as qe, useContext as Ge, useImperativeHandle as Je } from "react";
15
- import "./C6Kfwj0f.js";
16
- import { a as Qe } from "./Dr0iXIXO.js";
17
- import de from "../hooks/useForceUpdate.js";
18
- import Xe from "../hooks/useId.js";
19
- import Ye from "../hooks/useMergeProps.js";
20
- import be from "../hooks/useMergeValue.js";
21
- import re from "../hooks/useUpdateEffect.js";
22
- import Ze from "../SelectView.js";
23
- import et from "../Trigger.js";
24
- import q from "@unicom-cloud/utils/class-name";
25
- import { Enter as ue, ArrowLeft as tt, ArrowRight as nt, ArrowUp as we, ArrowDown as ae, Esc as he, Tab as rt } from "../utils/keyCode.js";
26
- import { TransitionGroup as lt, CSSTransition as st } from "@unicom-cloud/react-transition-group";
27
- import fe from "lodash/isEqualWith";
28
- import at from "@unicom-cloud/scroll-into-view-if-needed";
29
- import { C as _e } from "./i605JRmI.js";
30
- import it from "../hooks/useIsFirstRender.js";
31
- import { on as Oe, off as oe } from "../utils/dom.js";
32
- import { V as Le } from "./BGzBxiWE.js";
33
- import ct from "../hooks/useRefs.js";
34
- function ot(t, e) {
35
- const n = z(null), l = de();
36
- return n.current || (n.current = t()), re(() => {
37
- n.current = t(), l();
38
- }, [...e]), n.current;
39
- }
40
- class me {
41
- constructor(e, n, l) {
42
- d(this, "value");
43
- d(this, "label");
44
- // 是否禁用
45
- d(this, "disabled");
46
- d(this, "_level");
47
- d(this, "_index");
48
- d(this, "isLeaf");
49
- d(this, "disableCheckbox");
50
- // 是否选中
51
- d(this, "_checked");
52
- /** 是否半选 */
53
- d(this, "_halfChecked");
54
- /** 当前选项节点的父节点 */
55
- d(this, "parent");
56
- /** 当前选项节点路径的所有节点的值 */
57
- d(this, "pathValue", []);
58
- d(this, "pathLabel", []);
59
- /** 下一级选项 */
60
- d(this, "children");
61
- /** 是否在加载中 */
62
- d(this, "loading");
63
- /** 是否加载完成 */
64
- d(this, "loaded");
65
- d(this, "config", {});
66
- // 保存暴露给外部的属性
67
- d(this, "_data");
68
- d(this, "_initNode", (e, n = null) => {
69
- const { showEmptyChildren: l, lazyload: a } = this.config, c = { ...Ee, ...this.config.fieldNames }, r = e[c.children];
70
- let k = Array.isArray(r) ? l ? !1 : r.length === 0 : !0;
71
- a && (c.isLeaf in e ? k = !!e[c.isLeaf] : k = !1);
72
- const _ = e[c.value], I = e[c.label], b = {
73
- ...e,
74
- value: _,
75
- label: I,
76
- isLeaf: k,
77
- loading: !1,
78
- loaded: !1,
79
- disabled: n && n.disabled || e[c.disabled],
80
- parent: n,
81
- pathValue: n ? [...n.pathValue, _] : [_],
82
- pathLabel: n ? [...n.pathLabel, I] : [I],
83
- _level: n ? n._level + 1 : 0,
84
- _checked: !1,
85
- _halfChecked: !1
86
- };
87
- this._data = {
88
- ...b,
89
- parent: b.parent && b.parent._data
90
- }, Object.keys(b).forEach((x) => {
91
- this[x] = b[x];
92
- }), r && r.length && (this.children = r.map((x, N) => new me({ ...x, _index: N }, this.config, this)), this._data.children = this.children.map((x) => x._data));
93
- });
94
- /**
95
- * 根据this.children 计算是否当前node半选状态
96
- * 假设半选是 0.5,全选是1,不选是0。
97
- * 那么只有当前节点的所有children加起来等于children.length,才是全选,否则和大于0,就是半选。
98
- */
99
- d(this, "_isHalfChecked", () => {
100
- const e = this.children.reduce((n, l) => {
101
- const a = l._halfChecked ? 0.5 : l._checked ? 1 : 0;
102
- return n + a;
103
- }, 0);
104
- return e !== this.children.length && e > 0;
105
- });
106
- /**
107
- *
108
- * @param checked 选中状态
109
- * @param ignoreDisabled 是否忽略节点禁用设置选中状态,一般在初始化设置选中状态时传参为true
110
- */
111
- d(this, "_setNodeChildrenChecked", (e, n) => {
112
- !n && this.disabled || this.children && this.children.length && (this.children.forEach((l) => {
113
- l.disabled ? n && l.setCheckedStateIgnoreDisabled(e) : l.setCheckedState(e);
114
- }), this.updateHalfState(e));
115
- });
116
- d(this, "getSelfChildrenValue", () => {
117
- const e = [], n = (l, a) => {
118
- if (!a || !a.length) {
119
- e.push(l);
120
- return;
121
- }
122
- (a || []).forEach((c) => {
123
- n(c.pathValue, c.children);
124
- });
125
- };
126
- return n(this.pathValue, this.children), e;
127
- });
128
- d(this, "updateHalfState", (e) => {
129
- this._halfChecked = this._isHalfChecked(), this._checked = this._halfChecked ? !1 : e;
130
- });
131
- // 直接设置选中状态
132
- d(this, "setCheckedProperty", (e) => {
133
- this._checked = e, this._halfChecked = !1;
134
- });
135
- // 设置当前节点选中状态
136
- d(this, "setCheckedState", (e) => {
137
- const n = e ? this._checked : !this._checked && !this._halfChecked;
138
- if (!(this.disabled || n) && (this.setCheckedProperty(e), !this.config.changeOnSelect)) {
139
- this._setNodeChildrenChecked(e);
140
- let l = this.parent;
141
- for (; l && !l.disabled; )
142
- l.updateHalfState(e), l = l.parent;
143
- }
144
- });
145
- // 忽略禁用设置选中状态
146
- d(this, "setCheckedStateIgnoreDisabled", (e) => {
147
- if (e !== !!this._checked && (this.setCheckedProperty(e), !this.config.changeOnSelect)) {
148
- this._setNodeChildrenChecked(e, !0);
149
- let n = this.parent;
150
- for (; n; )
151
- n.updateHalfState(e), n = n.parent;
152
- }
153
- });
154
- /**
155
- * 遍历节点的parent,获取当前节点的路径节点。
156
- * node: { label: '1-1-1', parent: { label: '1-1', parent: { label: '1' }, ... }, ...}
157
- * @return [node.parent.parent, node.parent, node]
158
- * @memberof Store
159
- */
160
- d(this, "getPathNodes", () => {
161
- const e = [this];
162
- let n = this.parent;
163
- for (; n; )
164
- e.unshift(n), n = n.parent;
165
- return e;
166
- });
167
- d(this, "getChildren", () => this.children);
168
- d(this, "setLoading", (e) => {
169
- this.loading = e, (e || e === void 0) && (this.loaded = !1), e === !1 && (this.loaded = !0);
170
- });
171
- this.config = n || {}, this._initNode(e, l || null);
172
- }
173
- }
174
- class dt {
175
- constructor(e, n, l) {
176
- d(this, "nodes", []);
177
- d(this, "flatNodes", []);
178
- d(this, "config", {});
179
- // 初始化节点状态,附加状态信息字段: _checked,_halfChecked,parent,disabled
180
- d(this, "_calcNodes", (e, n) => e ? e.map((l, a) => new me({ ...l, _index: a }, this.config, n)) : []);
181
- // this.flatNodes 保存所有可能的选中项
182
- d(this, "_updateFlatNodes", () => {
183
- const e = !this.config.changeOnSelect;
184
- this.flatNodes = [];
185
- const n = (l) => {
186
- l && ((!e || l.isLeaf) && this.flatNodes.push(l), Se(l.children) && l.children.forEach((a) => {
187
- n(a);
188
- }));
189
- };
190
- this.nodes.forEach((l) => {
191
- n(l);
192
- });
193
- });
194
- /**
195
- * values: 全部的选中值
196
- * 根据values更新节点状态。不包含在values的节点都设置为未选中状态
197
- * @memberof Store
198
- */
199
- d(this, "setNodeCheckedByValue", (e) => {
200
- const n = ie(e);
201
- this.flatNodes.forEach((l) => {
202
- let a = !1;
203
- this.config.showParent ? l.pathValue.some(
204
- (c, r, k) => G(n, k.slice(0, r + 1))
205
- ) && (a = !0) : G(n, l.pathValue) && (a = !0), l.setCheckedStateIgnoreDisabled(a);
206
- });
207
- });
208
- /**
209
- * 为当前节点插入子节点。动态加载时候用到
210
- */
211
- d(this, "appendOptionChildren", (e, n) => {
212
- if (n && e) {
213
- const l = this._calcNodes(n, e);
214
- e.children = l, this._updateFlatNodes(), this.config.changeOnSelect || e.setCheckedState(!1);
215
- }
216
- });
217
- /**
218
- * 通过 value 查找对应的node节点。
219
- * value: 是路径节点的value组成的数组
220
- */
221
- d(this, "findNodeByValue", (e) => {
222
- let n = null;
223
- return !e || !e.length || this.flatNodes.some((l) => {
224
- fe(l.pathValue, e) && (n = l);
225
- }), n;
226
- });
227
- /**
228
- * 搜索所有label含有关键字的节点
229
- */
230
- d(this, "searchNodeByLabel", (e) => {
231
- if (!e)
232
- return this.flatNodes;
233
- const { filterOption: n } = this.config, l = W(n) ? n : (a, c) => X(c.label) && c.label.indexOf(a) > -1;
234
- return this.flatNodes.filter((a) => a.getPathNodes().some((r) => l(e, r._data)));
235
- });
236
- /** 获取所有节点 */
237
- d(this, "getOptions", () => this.nodes);
238
- /** 获取所有选中状态的节点。 aggregation: 是否聚合节点 */
239
- d(this, "getCheckedNodes", () => this.config.showParent ? this.getCheckedParentNodes() : this.flatNodes.filter((e) => e._checked));
240
- // 按照父节点纬度聚合当前所有选中节点。
241
- d(this, "getCheckedParentNodes", () => {
242
- const e = /* @__PURE__ */ new Set();
243
- return this.flatNodes.forEach((n) => {
244
- n._checked && n.getPathNodes().some((a) => {
245
- if (a._checked)
246
- return e.has(a) || e.add(a), !0;
247
- });
248
- }), Array.from(e);
249
- });
250
- this.config = { ...l };
251
- const a = Array.isArray(n) ? n : [];
252
- this.nodes = this._calcNodes(e, null), this._updateFlatNodes(), this.setNodeCheckedByValue(a);
253
- }
254
- }
255
- const J = "__pqb_cascader__", ut = "parent", ht = "child", ve = {
256
- cascader: "cascader",
257
- select: "select"
258
- };
259
- function Pe(t) {
260
- return {
261
- showEmptyChildren: t.showEmptyChildren,
262
- changeOnSelect: t.changeOnSelect,
263
- lazyload: !!t.loadMore,
264
- fieldNames: t.fieldNames,
265
- filterOption: t.filterOption,
266
- showParent: t.mode === "multiple" && !t.changeOnSelect && t.checkedStrategy === ut
267
- };
268
- }
269
- function ft(t, e) {
270
- const n = e ? Array.isArray(e[0]) ? e : [e] : [];
271
- return new dt(t.options || [], n, Pe(t));
272
- }
273
- const ie = (t) => (t || []).reduce((l, a) => (l.add([].concat(a).join(J)), l), /* @__PURE__ */ new Set()), G = (t, e) => {
274
- const n = e || [];
275
- return t.has(n.join(J));
276
- }, mt = (t, e) => {
277
- const n = e || [];
278
- return t.delete(n.join(J));
279
- }, Z = (t, e, n) => {
280
- let l = [];
281
- if (t === void 0 ? l = [] : e ? l = t : l = [t], n && n.config.showParent) {
282
- const a = n.getCheckedNodes(), c = ie(
283
- a.map((_) => _.pathValue)
284
- ), r = [], k = {};
285
- return l.map((_) => {
286
- _.some((I, b, x) => {
287
- const N = x.slice(0, b + 1), E = G(c, N);
288
- return E && !k[N.join(J)] && (r.push(N), k[N.join(J)] = 1), E;
289
- });
290
- }), r;
291
- }
292
- return l;
293
- }, gt = (t) => {
294
- const e = (n) => Array.isArray(n) ? n.every((l) => l._checked || l.disabled ? !0 : e(l.children)) : !1;
295
- return t._halfChecked && e(t == null ? void 0 : t.children);
296
- }, xe = (t, e, n, l) => {
297
- const a = l && gt(n) ? !1 : l, c = e.getCheckedNodes().reduce((b, x) => (b.add(x.pathValue.join(J)), b), /* @__PURE__ */ new Set());
298
- n.setCheckedState(a);
299
- const k = e.getCheckedNodes().map((b) => b.pathValue), _ = ie(k), I = /* @__PURE__ */ new Set();
300
- return t.filter((b) => {
301
- if (!G(c, b) || G(_, b))
302
- return I.add(b.join(J)), !0;
303
- }).concat(
304
- k.filter((b) => !G(I, b))
305
- );
306
- }, pt = (t) => {
307
- const { prefixCls: e, multiple: n, option: l, renderOption: a, selected: c, icons: r } = t, k = l.disabled || n && l.disableCheckbox;
308
- return /* @__PURE__ */ te(ne, { children: [
309
- n ? /* @__PURE__ */ g(
310
- _e,
311
- {
312
- disabled: k,
313
- checked: l._checked,
314
- indeterminate: l._halfChecked,
315
- onChange: t.onMultipleChecked,
316
- value: l.value
317
- }
318
- ) : "",
319
- /* @__PURE__ */ te(
320
- "div",
321
- {
322
- className: `${e}-list-item-label`,
323
- onClick: l.disabled ? void 0 : t.onClickOption,
324
- onMouseEnter: t.onMouseEnter,
325
- onDoubleClick: k ? void 0 : t.onDoubleClickOption,
326
- children: [
327
- a ? a() : l.label,
328
- l.isLeaf ? c && r.checked : l.loading ? r.loading : r.next
329
- ]
330
- }
331
- )
332
- ] });
333
- }, Ct = (t) => {
334
- for (let e = 0; e < t.length; e++)
335
- if (!t[e].disabled)
336
- return t[e];
337
- }, ye = (t) => {
338
- if (t && t.disabled) {
339
- let e = t;
340
- for (; e.parent && e.parent.disabled; )
341
- e = e.parent;
342
- return e;
343
- }
344
- return t;
345
- }, Ne = (t, e) => t < 0 ? e : t > e ? 0 : t, kt = (t) => {
346
- var A;
347
- const [e, n] = ct(), l = de(), {
348
- store: a,
349
- prefixCls: c,
350
- value: r,
351
- multiple: k,
352
- renderFooter: _,
353
- renderOption: I,
354
- showEmptyChildren: b,
355
- loadMore: x,
356
- renderEmpty: N,
357
- rtl: E,
358
- icons: R
359
- } = t, [h, V] = le(
360
- a.findNodeByValue(r && r[r.length - 1]) || null
361
- ), O = a.getOptions(), j = (s) => {
362
- var u;
363
- (u = t.onChange) == null || u.call(t, s);
364
- }, S = async (s) => {
365
- if (!s.isLeaf && W(x) && !s.children) {
366
- s.setLoading(!0), l();
367
- try {
368
- const u = await x(
369
- s.pathValue,
370
- s.pathValue.length
371
- );
372
- a.appendOptionChildren(s, u), a.setNodeCheckedByValue(t.value);
373
- } catch (u) {
374
- console.error(u);
375
- }
376
- s.setLoading(!1), l();
377
- }
378
- }, f = async (s, u = !0) => {
379
- !s || s.disabled || (V(s), S(s), !k && u && (t.changeOnSelect || s.isLeaf) && j([s.pathValue]));
380
- }, L = (s, u) => {
381
- const C = xe(t.value, a, s, u);
382
- s === h && l(), V(s), t.changeOnSelect || S(s), j(C);
383
- }, P = se(
384
- (s = h) => {
385
- var C;
386
- let u = s;
387
- for (; u; )
388
- (C = e[u._level]) == null || C.scrollTo({
389
- index: u._index,
390
- options: { block: "nearest" }
391
- }), u = u._level < 1 ? null : u.parent;
392
- },
393
- [h]
394
- ), p = se(
395
- (s) => {
396
- var o;
397
- const u = s.key;
398
- let C;
399
- switch (u) {
400
- case he.key: {
401
- s.preventDefault(), (o = t.onEsc) == null || o.call(t);
402
- break;
403
- }
404
- case ae.key:
405
- case we.key: {
406
- if (!h)
407
- C = Ct(O);
408
- else {
409
- const $ = ye(h), U = $.parent && $.parent.children || O, F = u === ae.key ? 1 : -1;
410
- let K = Ne(
411
- $._index + F,
412
- U.length - 1
413
- );
414
- for (; K !== $._index && (C = U[K], C.disabled); )
415
- K = Ne(K + F, U.length - 1);
416
- }
417
- return P(C), f(C, !1), s.preventDefault(), !1;
418
- }
419
- case nt.key:
420
- return h && !h.disabled && (C = (h.children || [])[0] || h, f(C, !1)), s.preventDefault(), !1;
421
- case tt.key: {
422
- if (h) {
423
- const $ = ye(h);
424
- C = $.parent || $;
425
- }
426
- return f(C, !1), s.preventDefault(), !1;
427
- }
428
- case ue.key:
429
- return h && (k ? L(h, !h._checked) : f(h)), s.preventDefault(), !1;
430
- }
431
- },
432
- [h]
433
- );
434
- re(() => {
435
- V((s) => {
436
- let u;
437
- if (s && s.pathValue && s.pathValue.length) {
438
- const C = s.pathValue;
439
- let o = { children: O };
440
- C.map(($) => {
441
- const F = (o.children || []).find((K) => K.value === $);
442
- F && (o = F, u = F);
443
- });
444
- }
445
- return u;
446
- });
447
- }, [a]), Y(() => {
448
- t.popupVisible && O.length && setTimeout(P);
449
- }, [t.popupVisible]), Y(() => {
450
- const s = t.getTriggerElement();
451
- if (s)
452
- return t.popupVisible ? Oe(s, "keydown", p) : oe(s, "keydown", p), () => {
453
- oe(s, "keydown", p);
454
- };
455
- }, [t.popupVisible, p]);
456
- const D = (() => {
457
- const s = [O];
458
- return (h ? h.getPathNodes() : []).forEach((C) => {
459
- C && C.children && s.push(C.children);
460
- }), s;
461
- })(), w = W(t.dropdownColumnRender) ? t.dropdownColumnRender : (s) => s;
462
- return !D.length || !((A = D[0]) != null && A.length) ? /* @__PURE__ */ g(ne, { children: N() }) : /* @__PURE__ */ g(lt, { component: ze.Fragment, children: D.map((s, u) => {
463
- const C = _ ? _(u, h || null) : null;
464
- return s.length === 0 && !b ? null : /* @__PURE__ */ g(
465
- st,
466
- {
467
- timeout: {
468
- enter: 300,
469
- exit: 0
470
- },
471
- classNames: "cascaderSlide",
472
- onEnter: (o) => {
473
- o.style.marginLeft = `-${o.scrollWidth}px`;
474
- },
475
- onEntering: (o) => {
476
- o.style.marginLeft = "0px";
477
- },
478
- onEntered: (o) => {
479
- o.style.marginLeft = "";
480
- },
481
- children: /* @__PURE__ */ g(
482
- "div",
483
- {
484
- className: q(`${c}-list-column`, {
485
- [`${c}-list-column-virtual`]: t.virtualListProps && t.virtualListProps.threshold !== null,
486
- [`${c}-list-column-rtl`]: E
487
- }),
488
- style: {
489
- zIndex: D.length - u,
490
- ...t.dropdownMenuColumnStyle
491
- },
492
- children: w(
493
- /* @__PURE__ */ te(
494
- "div",
495
- {
496
- className: q(`${c}-list-wrapper`, {
497
- [`${c}-list-wrapper-with-footer`]: C !== null
498
- }),
499
- children: [
500
- s.length === 0 ? N == null ? void 0 : N(t.virtualListProps ? "100%" : 120) : /* @__PURE__ */ g(
501
- Le,
502
- {
503
- needFiller: !1,
504
- threshold: t.virtualListProps ? 100 : null,
505
- data: s,
506
- isStaticItemHeight: !0,
507
- itemKey: "value",
508
- ...ee(t.virtualListProps) ? t.virtualListProps : {},
509
- wrapper: "ul",
510
- role: "menu",
511
- ref: (o) => n(o, u),
512
- className: q(
513
- `${c}-list`,
514
- `${c}-list-select`,
515
- {
516
- [`${c}-list-multiple`]: k,
517
- [`${c}-list-rtl`]: E
518
- }
519
- ),
520
- children: (o) => {
521
- let $ = !1;
522
- return h && ($ = h.pathValue[u] === o.value), /* @__PURE__ */ g(
523
- "li",
524
- {
525
- tabIndex: 0,
526
- role: "menuitem",
527
- "aria-haspopup": !o.isLeaf,
528
- "aria-expanded": $ && !o.isLeaf,
529
- "aria-disabled": o.disabled,
530
- title: X(o.label) ? o.label : void 0,
531
- className: q(`${c}-list-item`, {
532
- [`${c}-list-item-active`]: $,
533
- [`${c}-list-item-disabled`]: o.disabled
534
- }),
535
- children: /* @__PURE__ */ g(
536
- pt,
537
- {
538
- prefixCls: c,
539
- rtl: E,
540
- multiple: k,
541
- option: o,
542
- selected: !k && o.isLeaf && fe(t.value, o.pathValue),
543
- icons: R,
544
- onMouseEnter: () => {
545
- o.disabled || t.expandTrigger === "hover" && (V(o), !o.isLeaf && S(o));
546
- },
547
- renderOption: I && (() => I(o._data, u)),
548
- onClickOption: () => {
549
- o.isLeaf && k && !o.disableCheckbox ? L(o, !o._checked) : f(o);
550
- },
551
- onMultipleChecked: (U) => {
552
- L(o, U);
553
- },
554
- onDoubleClickOption: t.onDoubleClickOption
555
- }
556
- )
557
- },
558
- o.value
559
- );
560
- }
561
- }
562
- ),
563
- C && /* @__PURE__ */ g(
564
- "div",
565
- {
566
- className: `${c}-list-footer`,
567
- onMouseDown: (o) => {
568
- o.stopPropagation();
569
- },
570
- children: C
571
- }
572
- )
573
- ]
574
- }
575
- ),
576
- u
577
- )
578
- }
579
- )
580
- },
581
- u
582
- );
583
- }) });
584
- }, Ve = (t, e) => t < 0 ? e : t > e ? 0 : t, bt = (t, e, n) => {
585
- let l = e;
586
- if (X(e)) {
587
- const a = e.toUpperCase().indexOf(t.toUpperCase());
588
- if (a > -1) {
589
- const c = e.substr(0, a), r = e.substr(a + t.length);
590
- l = /* @__PURE__ */ te(ne, { children: [
591
- c,
592
- /* @__PURE__ */ g("span", { className: `${n}-highlight`, children: e.substr(a, t.length) }),
593
- r
594
- ] });
595
- }
596
- }
597
- return l;
598
- }, vt = (t) => {
599
- const {
600
- store: e,
601
- prefixCls: n,
602
- multiple: l,
603
- onChange: a,
604
- inputValue: c,
605
- renderEmpty: r,
606
- style: k,
607
- defaultActiveFirstOption: _,
608
- rtl: I,
609
- icons: b
610
- } = t, x = t.value || [], [N, E] = le(
611
- e.searchNodeByLabel(c) || []
612
- ), R = z(), h = z(), V = it(), [O, j] = le(
613
- _ ? 0 : -1
614
- ), S = (f, L, P) => {
615
- if (P.stopPropagation(), !f.disabled)
616
- if (l) {
617
- const p = xe(
618
- t.value,
619
- e,
620
- f,
621
- L
622
- );
623
- a == null || a(p);
624
- } else
625
- a == null || a([f.pathValue]);
626
- };
627
- return re(() => {
628
- E(e.searchNodeByLabel(c));
629
- }, [c, e]), re(() => {
630
- j((f) => f > N.length - 1 ? _ ? 0 : -1 : f);
631
- }, [N]), Y(() => {
632
- const f = t.getTriggerElement();
633
- if (!f)
634
- return;
635
- const L = (P) => {
636
- var D;
637
- P.stopPropagation();
638
- const p = P.key;
639
- switch (p) {
640
- case he.key:
641
- return (D = t.onEsc) == null || D.call(t), !1;
642
- case ae.key:
643
- case we.key: {
644
- h.current = !0;
645
- const w = ae.key === p ? 1 : -1;
646
- let A = Ve(
647
- O + w,
648
- N.length - 1
649
- );
650
- for (; A !== O && N[A].disabled; )
651
- A = Ve(A + w, N.length - 1);
652
- return j(A), !1;
653
- }
654
- case ue.key: {
655
- const w = N[O];
656
- if (w) {
657
- const A = x.some((s) => fe(s, w.pathValue));
658
- S(w, !A, P);
659
- }
660
- return !1;
661
- }
662
- }
663
- };
664
- return Oe(f, "keydown", L), () => {
665
- oe(f, "keydown", L);
666
- };
667
- }, [N, O, x]), Y(() => {
668
- var L;
669
- const f = R.current;
670
- f && (h.current || V) && at(f, {
671
- behavior: "instant",
672
- block: "nearest",
673
- scrollMode: "if-needed",
674
- boundary: (L = f.parentNode) == null ? void 0 : L.parentNode
675
- });
676
- }, [O, N]), R.current = null, N.length ? /* @__PURE__ */ g("div", { className: `${n}-list-wrapper`, children: /* @__PURE__ */ g(
677
- Le,
678
- {
679
- needFiller: !1,
680
- wrapper: "ul",
681
- role: "menu",
682
- style: k,
683
- data: N,
684
- isStaticItemHeight: !0,
685
- threshold: t.virtualListProps ? 100 : null,
686
- ...ee(t.virtualListProps) ? t.virtualListProps : {},
687
- onMouseMove: () => {
688
- h.current = !1;
689
- },
690
- className: q(`${n}-list`, `${n}-list-search`, {
691
- [`${n}-list-multiple`]: l,
692
- [`${n}-list-rtl`]: I
693
- }),
694
- children: (f, L) => {
695
- const p = f.getPathNodes().map((s) => s.label).join(" / "), D = f._checked, w = { checked: D }, A = W(t.renderOption) ? t.renderOption(c, f._data, w) : bt(c, p, n);
696
- return /* @__PURE__ */ g(
697
- "li",
698
- {
699
- title: X(A) ? A : X(p) ? p : void 0,
700
- role: "menuitem",
701
- "aria-disabled": f.disabled,
702
- ref: (s) => {
703
- L === O && (R.current = s), D && !R.current && (R.current = s);
704
- },
705
- className: q(`${n}-list-search-item`, {
706
- [`${n}-list-search-item-active`]: D,
707
- [`${n}-list-search-item-hover`]: L === O,
708
- [`${n}-list-search-item-disabled`]: f.disabled
709
- }),
710
- onClick: (s) => {
711
- S(f, !D, s);
712
- },
713
- onMouseEnter: () => {
714
- !h.current && !f.disabled && j(L);
715
- },
716
- onMouseLeave: () => {
717
- !h.current && !f.disabled && j(_ ? 0 : -1);
718
- },
719
- children: /* @__PURE__ */ g("div", { className: `${n}-list-item-label`, children: W(t.renderOption) ? A : l ? /* @__PURE__ */ g(_e, { checked: D, disabled: f.disabled, children: A }) : /* @__PURE__ */ te(ne, { children: [
720
- A,
721
- D && /* @__PURE__ */ g("span", { className: `${n}-check-icon`, children: b.checked })
722
- ] }) })
723
- },
724
- L
725
- );
726
- }
727
- }
728
- ) }) : /* @__PURE__ */ g(ne, { children: r == null ? void 0 : r() });
729
- }, Ee = {
730
- label: "label",
731
- value: "value",
732
- isLeaf: "isLeaf",
733
- children: "children",
734
- disabled: "disabled"
735
- }, yt = {
736
- options: [],
737
- bordered: !0,
738
- fieldNames: Ee,
739
- trigger: "click",
740
- expandTrigger: "click",
741
- checkedStrategy: ht,
742
- defaultActiveFirstOption: !0
743
- }, Nt = { bottom: 4 };
744
- function Vt(t, e) {
745
- const { getPrefixCls: n, renderEmpty: l, componentConfig: a, rtl: c } = Ge(Qe), r = Ye(
746
- t,
747
- yt,
748
- a == null ? void 0 : a.Cascader
749
- ), {
750
- disabled: k,
751
- renderFormat: _,
752
- getPopupContainer: I,
753
- children: b,
754
- triggerProps: x,
755
- expandTrigger: N,
756
- icons: E
757
- } = r, R = {
758
- loading: (E == null ? void 0 : E.loading) || /* @__PURE__ */ g(je, {}),
759
- checked: (E == null ? void 0 : E.checked) || /* @__PURE__ */ g(He, {}),
760
- next: (E == null ? void 0 : E.next) || (c ? /* @__PURE__ */ g(Be, {}) : /* @__PURE__ */ g(Ue, {}))
761
- }, h = n("cascader"), V = r.mode === "multiple", O = z(null), j = de(), S = ot(() => ft(
762
- r,
763
- Z(
764
- "value" in r ? r.value : r.defaultValue,
765
- V
766
- )
767
- ), [JSON.stringify(Pe(r)), r.options]), [f, L] = le(() => "value" in r ? Z(r.value, V, S) : "defaultValue" in r ? Z(r.defaultValue, V, S) : []), P = "value" in r ? Z(r.value, V, S) : f, [p, D] = be(!1, {
768
- value: r.popupVisible,
769
- defaultValue: r.defaultPopupVisible
770
- }), [w, A, s] = be("", {
771
- value: "inputValue" in r ? r.inputValue || "" : void 0
772
- }), u = z(w), C = z(null), o = z(null), $ = z((S == null ? void 0 : S.getCheckedNodes()) || []), U = Xe(`${h}-popup-`), F = (i, m) => {
773
- var v;
774
- i !== u.current && (A(i), u.current = i, C.current = m, (v = r.onInputValueChange) == null || v.call(r, i, m));
775
- };
776
- function K(i) {
777
- return We(i) || Ke(i);
778
- }
779
- Y(() => {
780
- var m;
781
- const { current: i } = C;
782
- s === w && (i === "manual" || i === "optionListHide") && ((m = r.onSearch) == null || m.call(r, w, i)), w !== u.current && (u.current = w);
783
- }, [w]), Y(() => {
784
- const i = () => {
785
- clearTimeout(O.current), O.current = null;
786
- };
787
- return !p && w && (O.current && i(), O.current = setTimeout(() => {
788
- F("", "optionListHide"), O.current = null;
789
- }, 200)), () => {
790
- i();
791
- };
792
- }, [p]), re(() => {
793
- if ("value" in r && r.value !== f) {
794
- const i = Z(r.value, V);
795
- S.setNodeCheckedByValue(i), L(i);
796
- }
797
- }, [r.value, V]), Je(e, () => o.current, []);
798
- const Ae = (i) => {
799
- $.current = Array.from(
800
- new Set([].concat(i, $.current))
801
- );
802
- }, ge = (i) => {
803
- const m = [], v = ie(i), M = (y) => {
804
- y.some((T) => {
805
- if (G(v, T.pathValue) && (m.push(T.getPathNodes().map((B) => B._data)), mt(v, T.pathValue)), !v.size)
806
- return !0;
807
- });
808
- };
809
- return M(S.getCheckedNodes()), v.size && M($.current), m;
810
- }, H = se(
811
- (i) => {
812
- var m;
813
- i !== p && ((m = r.onVisibleChange) == null || m.call(r, i), "popupVisible" in r || D(i));
814
- },
815
- [r.onVisibleChange, p]
816
- ), $e = se(
817
- (i) => {
818
- var y;
819
- const m = ge([i])[0] || [];
820
- let v, M = Se(i) ? i.map((T) => String(T)) : [];
821
- return m.length && (M = m.map((T) => T.label)), W(_) ? v = _(M) : M.every((T) => X(T)) ? v = M.join(" / ") : v = M.reduce((T, B, ce) => T.concat(ce === 0 ? [B] : [" / ", B]), []), {
822
- text: v || "",
823
- disabled: (y = m[m.length - 1]) == null ? void 0 : y.disabled
824
- };
825
- },
826
- [S, _]
827
- ), Q = (i, m) => {
828
- var ke;
829
- m === "panel" && ee(r.showSearch) && !r.showSearch.retainInputValueWhileSelect && V && F("", "optionChecked");
830
- const { onChange: v, changeOnSelect: M, expandTrigger: y } = r;
831
- if (P === i)
832
- return;
833
- V || S.setNodeCheckedByValue(i), Ae(S.getCheckedNodes());
834
- const B = ge(i), ce = V ? i : i[0], Te = V ? B : B[0];
835
- V || (w || B[0] && ((ke = B[0][B[0].length - 1]) != null && ke.isLeaf) || M && y === "hover") && H(!1), "value" in r ? (S.setNodeCheckedByValue(P), j()) : L(i), v == null || v(ce, Te, {
836
- dropdownVisible: p
837
- });
838
- }, Me = (i, m, v) => {
839
- if (v.stopPropagation(), i.disabled)
840
- return;
841
- const M = P.filter((y, T) => T !== m);
842
- S.setNodeCheckedByValue(M), Q(M);
843
- }, pe = (i) => {
844
- const m = i || o.current && o.current.getWidth();
845
- return /* @__PURE__ */ g(
846
- "div",
847
- {
848
- className: `${h}-list-empty`,
849
- style: { width: m },
850
- children: r.notFoundContent || l("Cascader")
851
- }
852
- );
853
- }, De = () => {
854
- const i = ee(r.showSearch) ? r.showSearch.panelMode : void 0, m = i === ve.select ? !0 : i === ve.cascader ? !1 : !W(r.onSearch) && !!w, v = o.current && o.current.getWidth(), M = W(r.dropdownRender) ? r.dropdownRender : (y) => y;
855
- return /* @__PURE__ */ g(
856
- "div",
857
- {
858
- id: U,
859
- className: q(`${h}-popup`, r.dropdownMenuClassName, {
860
- [`${h}-popup-trigger-hover`]: r.expandTrigger === "hover"
861
- }),
862
- children: M(
863
- /* @__PURE__ */ g(
864
- "div",
865
- {
866
- className: `${h}-popup-inner`,
867
- onMouseDown: (y) => y.preventDefault(),
868
- children: m ? /* @__PURE__ */ g(
869
- vt,
870
- {
871
- style: { minWidth: v },
872
- store: S,
873
- inputValue: w,
874
- renderEmpty: () => pe(v),
875
- multiple: V,
876
- onChange: (y) => {
877
- Q(y, "panel");
878
- },
879
- prefixCls: h,
880
- rtl: c,
881
- onEsc: () => {
882
- H(!1);
883
- },
884
- renderOption: ee(r.showSearch) && r.showSearch.renderOption || void 0,
885
- getTriggerElement: () => {
886
- var y;
887
- return (y = o.current) == null ? void 0 : y.dom;
888
- },
889
- value: P,
890
- virtualListProps: r.virtualListProps,
891
- defaultActiveFirstOption: r.defaultActiveFirstOption,
892
- icons: R
893
- }
894
- ) : /* @__PURE__ */ g(
895
- kt,
896
- {
897
- dropdownMenuColumnStyle: r.dropdownMenuColumnStyle,
898
- virtualListProps: r.virtualListProps,
899
- expandTrigger: N,
900
- store: S,
901
- dropdownColumnRender: r.dropdownColumnRender,
902
- renderOption: r.renderOption,
903
- changeOnSelect: r.changeOnSelect,
904
- showEmptyChildren: r.showEmptyChildren || !!r.loadMore,
905
- multiple: V,
906
- onChange: (y) => {
907
- Q(y, "panel");
908
- },
909
- loadMore: r.loadMore,
910
- prefixCls: h,
911
- rtl: c,
912
- getTriggerElement: () => {
913
- var y;
914
- return (y = o.current) == null ? void 0 : y.dom;
915
- },
916
- renderEmpty: pe,
917
- popupVisible: p,
918
- value: P,
919
- renderFooter: r.renderFooter,
920
- icons: R,
921
- onEsc: () => {
922
- H(!1);
923
- },
924
- onDoubleClickOption: () => {
925
- r.changeOnSelect && !V && H(!1);
926
- }
927
- }
928
- )
929
- }
930
- )
931
- )
932
- }
933
- );
934
- }, Ie = (i) => {
935
- Q(i);
936
- }, Ce = (i) => /* @__PURE__ */ g(
937
- et,
938
- {
939
- popup: De,
940
- trigger: r.trigger,
941
- disabled: k,
942
- getPopupContainer: I,
943
- position: c ? "br" : "bl",
944
- classNames: "slideDynamicOrigin",
945
- popupAlign: Nt,
946
- unmountOnExit: "unmountOnExit" in r ? r.unmountOnExit : !W(r.loadMore),
947
- popupVisible: p,
948
- ...x,
949
- onVisibleChange: H,
950
- children: i
951
- }
952
- );
953
- return b ? Ce(b) : /* @__PURE__ */ g(
954
- Ze,
955
- {
956
- ...r,
957
- ref: o,
958
- ariaControls: U,
959
- popupVisible: p,
960
- value: V ? P : P && P[0],
961
- inputValue: w,
962
- rtl: c,
963
- isEmptyValue: K(P),
964
- prefixCls: h,
965
- isMultiple: V,
966
- renderText: $e,
967
- onRemoveCheckedItem: Me,
968
- onSort: Ie,
969
- renderView: Ce,
970
- onClear: (i) => {
971
- var m;
972
- if (i.stopPropagation(), !V)
973
- Q([]);
974
- else {
975
- const M = S.getCheckedNodes().filter((y) => y.disabled).map((y) => y.pathValue);
976
- S.setNodeCheckedByValue(M), Q(M);
977
- }
978
- (m = r.onClear) == null || m.call(r, !!p);
979
- },
980
- onKeyDown: (i) => {
981
- var v;
982
- if (k)
983
- return;
984
- i.stopPropagation();
985
- const m = i.key;
986
- m === he.key && p && (H(!1), i.preventDefault()), m === ue.key && !p && (H(!0), i.preventDefault()), m === rt.key && p && H(!1), (v = r.onKeyDown) == null || v.call(r, i);
987
- },
988
- onChangeInputValue: (i) => {
989
- F(i, "manual"), p || H(!0);
990
- }
991
- }
992
- );
993
- }
994
- const St = qe(
995
- Vt
996
- );
997
- St.displayName = "Cascader";
998
- export {
999
- St as C
1000
- };