@unicom-cloud/ui 0.8.43 → 0.8.45

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 (495) 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 -248
  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 -721
  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 -395
  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/locale/de-DE.js +1 -1
  262. package/mentions/util.js +26 -0
  263. package/menu/Indent.js +17 -0
  264. package/menu/Item.js +125 -0
  265. package/menu/ItemGroup.js +39 -0
  266. package/menu/Menu.js +181 -0
  267. package/menu/OverflowWrap.js +85 -0
  268. package/menu/context.js +5 -0
  269. package/menu/sub-menu/Inline.js +111 -0
  270. package/menu/sub-menu/Pop.js +126 -0
  271. package/menu/sub-menu/index.js +17 -0
  272. package/menu/util.js +80 -0
  273. package/message/useMessage.js +53 -0
  274. package/modal/Confirm.js +98 -0
  275. package/modal/Modal.js +419 -0
  276. package/modal/config.js +25 -0
  277. package/modal/use-modal/Hook.js +55 -0
  278. package/modal/use-modal/index.js +68 -0
  279. package/notification/useNotification.js +55 -0
  280. package/overflow-ellipsis/OverflowItem.js +34 -0
  281. package/package.json +27 -1
  282. package/pagination/PageItem.js +121 -0
  283. package/pagination/PageJumper.js +64 -0
  284. package/pagination/PageOption.js +55 -0
  285. package/pagination/Pagination.js +245 -0
  286. package/picker/Input.js +124 -0
  287. package/picker/InputRange.js +155 -0
  288. package/portal/Portal.js +25 -0
  289. package/progress/CircleProgress.js +117 -0
  290. package/progress/LineProgess.js +103 -0
  291. package/progress/StepProgress.js +74 -0
  292. package/radio/Group.js +91 -0
  293. package/radio/Radio.js +90 -0
  294. package/resize-box/ResizeTrigger.js +78 -0
  295. package/resize-box/Split.js +132 -0
  296. package/resize-box/SplitGroup.js +204 -0
  297. package/result/403.js +695 -0
  298. package/result/404.js +513 -0
  299. package/result/500.js +166 -0
  300. package/select/OptGroup.js +20 -0
  301. package/select/Option.js +97 -0
  302. package/select/Select.js +544 -0
  303. package/select/util.js +140 -0
  304. package/select-view/Core.js +309 -0
  305. package/skeleton/Image.js +24 -0
  306. package/skeleton/Text.js +27 -0
  307. package/slider/Button.js +159 -0
  308. package/slider/Dot.js +43 -0
  309. package/slider/Input.js +75 -0
  310. package/slider/Mark.js +28 -0
  311. package/slider/Tick.js +44 -0
  312. package/slider/hook/useInterval.js +73 -0
  313. package/slider/hook/useLegalValue.js +70 -0
  314. package/slider/util.js +63 -0
  315. package/space/toArray.js +11 -0
  316. package/spin/DotLoading.js +26 -0
  317. package/statistic/Countdown.js +57 -0
  318. package/statistic/util.js +33 -0
  319. package/steps/Step.js +68 -0
  320. package/style.css +1 -1
  321. package/table/ColGroup.js +59 -0
  322. package/table/Table.js +634 -0
  323. package/table/constant.js +5 -0
  324. package/table/hook/useColumns.js +141 -0
  325. package/table/hook/useComponent.js +64 -0
  326. package/table/hook/useExpand.js +36 -0
  327. package/table/hook/useRowSelection.js +92 -0
  328. package/table/hook/useSorter.js +54 -0
  329. package/table/hook/useStickyClassNames.js +30 -0
  330. package/table/hook/useStickyOffsets.js +30 -0
  331. package/table/summary/Cell.js +10 -0
  332. package/table/summary/Row.js +26 -0
  333. package/table/summary/context.js +5 -0
  334. package/table/summary/index.js +10 -0
  335. package/table/tbody/Td.js +160 -0
  336. package/table/tbody/Tr.js +168 -0
  337. package/table/tbody/index.js +156 -0
  338. package/table/tfoot/index.js +16 -0
  339. package/table/thead/Column.js +250 -0
  340. package/table/thead/index.js +131 -0
  341. package/table/util.js +121 -0
  342. package/tabs/Tab.js +170 -0
  343. package/tabs/TabContent.js +54 -0
  344. package/tabs/TabPane.js +26 -0
  345. package/tabs/hook/useDomSize.js +17 -0
  346. package/tabs/hook/useHeaderScroll.js +64 -0
  347. package/tabs/tab-header/DropdownIcon.js +71 -0
  348. package/tabs/tab-header/TabInk.js +65 -0
  349. package/tabs/tab-header/TabNavIcon.js +65 -0
  350. package/tabs/tab-header/TabTitle.js +78 -0
  351. package/tabs/tab-header/index.js +335 -0
  352. package/tabs/util.js +22 -0
  353. package/time-picker/Picker.js +221 -0
  354. package/time-picker/RangePicker.js +56 -0
  355. package/time-picker/TimeColumn.js +65 -0
  356. package/time-picker/TimePicker.js +242 -0
  357. package/time-picker/context.js +5 -0
  358. package/time-picker/util.js +43 -0
  359. package/timeline/Item.js +94 -0
  360. package/timeline/Timeline.js +80 -0
  361. package/transfer/Item.js +107 -0
  362. package/transfer/List.js +192 -0
  363. package/tree/Animation.js +104 -0
  364. package/tree/Context.js +5 -0
  365. package/tree/Node.js +215 -0
  366. package/tree/NodeList.js +84 -0
  367. package/tree/Tree.js +549 -0
  368. package/tree/util.js +76 -0
  369. package/tree-select/List.js +127 -0
  370. package/tree-select/Select.js +260 -0
  371. package/tree-select/hook/useKeyCache.js +56 -0
  372. package/tree-select/hook/useStateValue.js +98 -0
  373. package/tree-select/hook/useTreeData.js +13 -0
  374. package/tree-select/interface.js +13 -0
  375. package/tree-select/util.js +9 -0
  376. package/trigger/Portal.js +14 -0
  377. package/trigger/getPopupStyle.js +190 -0
  378. package/types/badge/Count.d.ts +2 -1
  379. package/types/badge/index.d.ts +2 -2
  380. package/types/button/index.d.ts +2 -2
  381. package/types/carousel/index.d.ts +1 -1
  382. package/types/color-picker/colors.d.ts +1 -1
  383. package/types/color-picker/style/index.d.ts +1 -1
  384. package/types/drawer/Drawer.d.ts +1 -1
  385. package/types/dropdown/interface.d.ts +1 -0
  386. package/types/grid/index.d.ts +1 -0
  387. package/types/hooks/index.d.ts +122 -0
  388. package/types/hooks/use-verification-code/interface.d.ts +1 -1
  389. package/types/hooks/useAsync.d.ts +1 -1
  390. package/types/hooks/useDropArea.d.ts +1 -0
  391. package/types/hooks/useOverrideRef.d.ts +5 -0
  392. package/types/hooks/usePersistCallback.d.ts +1 -0
  393. package/types/hooks/useUpsert.d.ts +1 -1
  394. package/types/icon-hover/index.d.ts +5 -3
  395. package/types/index.d.ts +4 -120
  396. package/types/input-tag/InputTag.d.ts +1 -1
  397. package/types/input-tag/interface.d.ts +1 -1
  398. package/types/link/interface.d.ts +1 -1
  399. package/types/list/index.d.ts +1 -1
  400. package/types/modal/interface.d.ts +1 -0
  401. package/types/notice/index.d.ts +3 -0
  402. package/types/notification/index.d.ts +1 -1
  403. package/types/page-header/index.d.ts +1 -1
  404. package/types/select/Select.d.ts +1 -1
  405. package/types/select-view/Core.d.ts +3 -2
  406. package/types/select-view/index.d.ts +1 -0
  407. package/types/statistic/index.d.ts +1 -1
  408. package/types/switch/index.d.ts +1 -1
  409. package/types/switch/interface.d.ts +1 -1
  410. package/types/table/interface.d.ts +2 -1
  411. package/types/tooltip/index.d.ts +1 -1
  412. package/types/trigger/index.d.ts +12 -8
  413. package/types/trigger/interface.d.ts +1 -0
  414. package/types/typography/Base.d.ts +8 -7
  415. package/types/typography/EditContent.d.ts +3 -2
  416. package/types/typography/Paragraph.d.ts +2 -5
  417. package/types/typography/Text.d.ts +1 -5
  418. package/types/typography/Title.d.ts +2 -5
  419. package/types/upload/TriggerNode.d.ts +5 -3
  420. package/types/upload/list/PictureItem.d.ts +3 -3
  421. package/types/upload/list/TextItem.d.ts +3 -3
  422. package/types/utils/CSSTransition.d.ts +2 -0
  423. package/types/utils/constant.d.ts +1 -1
  424. package/types/utils/is.d.ts +4 -0
  425. package/types/utils/reactDOM.d.ts +3 -1
  426. package/types/utils/warning.d.ts +1 -1
  427. package/types/version/index.d.ts +1 -1
  428. package/typography/Base.js +184 -0
  429. package/typography/EditContent.js +49 -0
  430. package/typography/Ellipsis.js +293 -0
  431. package/typography/Operations.js +78 -0
  432. package/typography/Paragraph.js +26 -0
  433. package/typography/Text.js +11 -0
  434. package/typography/Title.js +12 -0
  435. package/typography/Typography.js +15 -0
  436. package/typography/useCssEllipsis.js +37 -0
  437. package/typography/useEllipsis.js +150 -0
  438. package/upload/TriggerNode.js +118 -0
  439. package/upload/Upload.js +205 -0
  440. package/upload/Uploader.js +205 -0
  441. package/upload/interface.js +9 -0
  442. package/upload/list/PictureItem.js +91 -0
  443. package/upload/list/TextItem.js +99 -0
  444. package/upload/list/UploadProgress.js +97 -0
  445. package/upload/list/index.js +120 -0
  446. package/upload/request.js +51 -0
  447. package/upload/util.js +61 -0
  448. package/utils/CSSTransition.js +27 -0
  449. package/utils/contextHolder.js +29 -4
  450. package/utils/getHighlightText.js +1 -2
  451. package/utils/is.js +81 -68
  452. package/utils/reactDOM.js +33 -22
  453. package/utils/style.js +1 -2
  454. package/utils/warning.js +7 -3
  455. package/verification-code/VerificationCode.js +83 -0
  456. package/virtual-list/Filler.js +31 -0
  457. package/virtual-list/VirtualList.js +378 -0
  458. package/virtual-list/util/algorithm.js +32 -0
  459. package/virtual-list/util/item.js +99 -0
  460. package/{chunk/BCEX3Acw.js → watermark/Watermark.js} +13 -11
  461. package/chunk/B1P8u7kB.js +0 -798
  462. package/chunk/B2ufZjjd.js +0 -1000
  463. package/chunk/B7QOJqps.js +0 -162
  464. package/chunk/BBz3S3zo.js +0 -966
  465. package/chunk/BGzBxiWE.js +0 -517
  466. package/chunk/BNRfcEHj.js +0 -984
  467. package/chunk/BSs6uXmc.js +0 -946
  468. package/chunk/BTjUAV8T.js +0 -277
  469. package/chunk/BYQeEcKe.js +0 -375
  470. package/chunk/Ba4UXIST.js +0 -605
  471. package/chunk/BfaXVcik.js +0 -271
  472. package/chunk/Bs11tCU6.js +0 -240
  473. package/chunk/C7FC7dzS.js +0 -516
  474. package/chunk/CLzbve11.js +0 -694
  475. package/chunk/CN4zXU4b.js +0 -877
  476. package/chunk/CYTPZUHD.js +0 -769
  477. package/chunk/CcCo_dK0.js +0 -335
  478. package/chunk/CoCXcpQd.js +0 -261
  479. package/chunk/D4yH4UKK.js +0 -80
  480. package/chunk/DiSLYN2-.js +0 -167
  481. package/chunk/Dr0iXIXO.js +0 -736
  482. package/chunk/G3-2uJao.js +0 -229
  483. package/chunk/RnTpOC5-.js +0 -1
  484. package/chunk/Z-mtdHUQ.js +0 -226
  485. package/chunk/ZISxNnaR.js +0 -165
  486. package/chunk/aPJXnDSb.js +0 -450
  487. package/chunk/i605JRmI.js +0 -232
  488. package/chunk/l0sNRNKZ.js +0 -1
  489. package/types/form/FormItemTip.d.ts +0 -8
  490. /package/{chunk/C6Kfwj0f.js → loading/style/index.less.js} +0 -0
  491. /package/{chunk/DP2rzg_V.js → suspense-fallback-test/style/index.less.js} +0 -0
  492. /package/types/{Popover → popover}/index.d.ts +0 -0
  493. /package/types/{Popover → popover}/interface.d.ts +0 -0
  494. /package/types/{Popover → popover}/style/index.d.ts +0 -0
  495. /package/{chunk/K6Dvbx-E.js → virtual-list/style/index.less.js} +0 -0
package/Trigger.js CHANGED
@@ -1,227 +1,39 @@
1
- var it = Object.defineProperty;
2
- var ot = (h, l, t) => l in h ? it(h, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[l] = t;
3
- var s = (h, l, t) => (ot(h, typeof l != "symbol" ? l + "" : l, t), t);
4
- import { jsx as R, jsxs as X } from "react/jsx-runtime";
5
- import "./chunk/C6Kfwj0f.js";
6
- import { CSSTransition as st } from "@unicom-cloud/react-transition-group";
7
- import rt from "lodash/isArray";
8
- import nt from "lodash/isEqual";
9
- import W from "lodash/isFunction";
10
- import q from "lodash/isPlainObject";
11
- import A, { useRef as lt, useEffect as pt, PureComponent as ht } from "react";
12
- import ut, { findDOMNode as at } from "react-dom";
13
- import { a as ct } from "./chunk/Dr0iXIXO.js";
14
- import _ from "@unicom-cloud/utils/class-name";
15
- import { isServerRendering as tt, on as U, off as Y, getScrollElements as ft, isScrollElement as dt, contains as Q } from "./utils/dom.js";
16
- import { Esc as K } from "./utils/keyCode.js";
17
- import gt from "./utils/mergeProp.js";
18
- import { pickDataAttributes as mt } from "./utils/pick.js";
19
- import { caf as G, raf as bt } from "./utils/raf.js";
20
- import j from "./utils/throttleByRaf.js";
21
- import Pt from "./hooks/useIsFirstRender.js";
22
- import { isArray as Tt } from "./utils/is.js";
23
- const yt = (h) => {
24
- const { getContainer: l, children: t } = h, e = lt();
25
- return (Pt() || e.current === null) && !tt && (e.current = l()), pt(() => () => {
26
- const r = e.current;
27
- r && r.parentNode && (r.parentNode.removeChild(r), e.current = null);
28
- }, []), e.current ? ut.createPortal(t, e.current) : null;
29
- }, B = 0, I = (h, l) => {
30
- const { position: t } = l, { width: e, height: i, left: r, right: n, top: u, bottom: P } = h.getBoundingClientRect(), o = l.boundaryDistance || {}, M = "left" in o && o.left || B, g = "top" in o && o.top || B;
31
- let a, c, f, m;
32
- return ["bottom", "bl", "br"].indexOf(t) > -1 ? (f = u, m = P) : (f = u - g, m = P - g), ["right", "rt", "rb"].indexOf(t) > -1 ? (a = r, c = n) : (a = r - M, c = n - M), {
33
- width: e,
34
- height: i,
35
- left: a,
36
- right: c,
37
- top: f,
38
- bottom: m
39
- };
40
- };
41
- function wt(h, l, t, e) {
42
- if (!t || !h || tt)
43
- return { left: 0, width: 0, height: 0, top: 0 };
44
- const i = (m) => document.documentElement[m] || document.body[m], r = t === document.body ? i("scrollTop") : t.scrollTop, n = t === document.body ? i("scrollLeft") : t.scrollLeft, { left: u, top: P, width: o, height: M } = l, g = t === document.body ? 0 : I(t, e).left, a = t === document.body ? 0 : I(t, e).top, c = P + r - a;
45
- return {
46
- left: u + n - g,
47
- top: c,
48
- width: o,
49
- height: M
50
- };
51
- }
52
- const E = function(h, l, t) {
53
- return t < h ? h : t > l ? l : t;
54
- }, Ct = (h, l) => {
55
- let t = 0, e = 0, i = {};
56
- l ? i = {
57
- left: 12,
58
- right: 12,
59
- top: 12,
60
- bottom: 12,
61
- ...h
62
- } : i = { ...h };
63
- for (const r in i)
64
- if (Tt(i[r])) {
65
- let n = 0;
66
- ["top", "bottom"].indexOf(r) > -1 ? (n = 1, t = i[r][0]) : e = i[r][1], i[r] = i[r][n];
67
- }
68
- return {
69
- ...i,
70
- horizontalOffset: t,
71
- verticalOffset: e
72
- };
73
- }, vt = (h, l, { boundaryDistance: t, position: e }) => l ? {
74
- left: l.clientX,
75
- top: l.clientY,
76
- width: 0,
77
- height: 0,
78
- right: l.clientX,
79
- bottom: l.clientY
80
- } : I(h, { boundaryDistance: t, position: e }), Mt = (h) => {
81
- const l = h.offsetWidth, t = h.offsetHeight;
82
- return {
83
- width: l,
84
- height: t
85
- };
86
- }, Ot = (h) => {
87
- var n, u;
88
- const l = h || {}, t = "left" in l ? l.left : "right" in l ? l.right : B, e = "top" in l ? l.top : "bottom" in l ? l.bottom : B, i = (((n = document.documentElement) == null ? void 0 : n.clientHeight) || window.innerHeight) - (e || B), r = (((u = document.documentElement) == null ? void 0 : u.clientWidth) || window.innerWidth) - (t || B);
89
- return {
90
- windowHeight: i,
91
- windowWidth: r
92
- };
93
- }, Dt = (h, l, t, e, i) => {
94
- const {
95
- autoAlignPopupWidth: r,
96
- autoAlignPopupMinWidth: n,
97
- alignPoint: u,
98
- style: P
99
- } = h;
100
- if (!t || !l || !e)
1
+ var J = Object.defineProperty;
2
+ var Z = (u, h, e) => h in u ? J(u, h, { enumerable: !0, configurable: !0, writable: !0, value: e }) : u[h] = e;
3
+ var i = (u, h, e) => Z(u, typeof h != "symbol" ? h + "" : h, e);
4
+ import { jsx as d, jsxs as V } from "react/jsx-runtime";
5
+ /* empty css */
6
+ /* empty css */
7
+ import { CSSTransition as ee } from "@unicom-cloud/react-transition-group";
8
+ import te from "lodash/isArray";
9
+ import ie from "lodash/isEqual";
10
+ import g from "lodash/isFunction";
11
+ import C, { PureComponent as se, createRef as H } from "react";
12
+ import "./config-provider/ConfigProvider.js";
13
+ import b from "@unicom-cloud/utils/class-name";
14
+ import { on as w, off as R, getScrollElements as oe, isScrollElement as re, contains as $ } from "./utils/dom.js";
15
+ import { isObject as L, supportRef as ne } from "./utils/is.js";
16
+ import { Esc as N } from "./utils/keyCode.js";
17
+ import pe from "./utils/mergeProp.js";
18
+ import { pickDataAttributes as le } from "./utils/pick.js";
19
+ import { caf as k, raf as ue } from "./utils/raf.js";
20
+ import { findDOMNode as he, callbackOriginRef as ae } from "./utils/reactDOM.js";
21
+ import F from "./utils/throttleByRaf.js";
22
+ import ce from "./trigger/Portal.js";
23
+ import de, { getBoundingClientRect as ge } from "./trigger/getPopupStyle.js";
24
+ import { ConfigContext as fe } from "./config-provider/context.js";
25
+ function B(u, h) {
26
+ if (!u)
101
27
  return {};
102
- const o = {}, M = !h.alignPoint && h.boundaryDistance || {}, g = vt(t, u && i, {
103
- boundaryDistance: M,
104
- position: h.position
105
- }), { left: a, top: c, width: f, height: m } = wt(
106
- t,
107
- g,
108
- e,
109
- {
110
- boundaryDistance: M,
111
- position: h.position
112
- }
113
- ), V = Ct(h.popupAlign, h.showArrow), H = V.left || 0, N = V.right || 0, k = V.top || 0, F = V.bottom || 0;
114
- r && (P == null ? void 0 : P.width) === void 0 && (l.style.width = `${t.offsetWidth}px`), n && (l.style.minWidth = `${t.offsetWidth}px`);
115
- const p = Mt(l);
116
- let v = h.position;
117
- const y = {}, O = (D) => {
118
- if (!h.autoFitPosition)
119
- return;
120
- const { windowHeight: S, windowWidth: z } = Ot(M);
121
- let L = !1;
122
- const b = {
123
- left: a - g.left,
124
- top: c - g.top
125
- }, { top: $ = 0, left: T = 0 } = o;
126
- if ((D === "top" || D === "bottom") && (b.left > T && g.right > 12 ? (o.left = Math.max(b.left, a - p.width), o.left = Math.max(
127
- o.left,
128
- a - p.width + 24
129
- )) : T - b.left + p.width > z && z - g.left > 12 && (o.left = Math.max(
130
- b.left,
131
- b.left + z - p.width
132
- ), o.left = Math.max(
133
- o.left,
134
- a - p.width + 24
135
- ))), (D === "left" || D === "right") && (b.top > $ && g.bottom > 12 ? (o.top = b.top, o.top = Math.max(
136
- o.top,
137
- c - p.height + g.height / 2
138
- )) : $ - b.top + p.height > S && S - g.top > 12 && (o.top = Math.max(
139
- b.top,
140
- b.top + S - p.height
141
- ), o.top = Math.max(
142
- o.top,
143
- c - p.height + g.height / 2
144
- ))), D === "top" && b.top > $ && (g.top < S - g.bottom ? (o.top = Math.min(
145
- c + m + (k || 0),
146
- b.top + S - p.height
147
- ), L = !0) : o.top = b.top), D === "bottom" && $ - b.top + p.height > S && (S - g.bottom < g.top ? (o.top = Math.max(
148
- c - p.height - (F || 0),
149
- b.top
150
- ), L = !0) : o.top = b.top + S - p.height), D === "left" && b.left > T && (g.left < z - g.right ? (o.left = Math.min(
151
- f + a + N,
152
- b.left + z - p.width
153
- ), L = !0) : o.left = b.left), D === "right" && T - b.left + p.width > z && (z - g.right < g.left ? (o.left = Math.max(
154
- a - p.width - H,
155
- b.left
156
- ), L = !0) : o.left = b.left + z - p.width), o.left < 0)
157
- o.left = 0;
158
- else {
159
- const et = e.scrollWidth - p.width;
160
- o.left = Math.min(et, o.left);
161
- }
162
- return L;
163
- }, d = V.horizontalOffset || 0, x = V.verticalOffset || 0;
164
- let C = a - Number(o.left) + f / 2, w = c - Number(o.top) + m / 2;
165
- switch (h.position) {
166
- case "top": {
167
- o.top = c - p.height - k, o.left = a + f / 2 - p.width / 2, O("top") && (v = "bottom"), o.left += d, C = a - Number(o.left) + f / 2, y.left = E(12, p.width - 12, C);
168
- break;
169
- }
170
- case "tl":
171
- o.top = c - p.height - k, o.left = a, O("top") && (v = "bl"), o.left += d, C = a - Number(o.left) + Math.min(f / 2, 50), y.left = E(12, p.width - 12, C);
172
- break;
173
- case "tr":
174
- o.top = -l.clientHeight + c - k, o.left = a + f - p.width, O("top") && (v = "br"), o.left += d, C = a - Number(o.left) + Math.max(f / 2, f - 50), y.left = E(12, p.width - 12, C);
175
- break;
176
- case "bottom": {
177
- o.top = m + c + F, o.left = a + f / 2 - p.width / 2, O("bottom") && (v = "top"), o.left += d, C = a - Number(o.left) + f / 2, y.left = E(12, p.width - 12, C);
178
- break;
179
- }
180
- case "bl":
181
- o.top = m + c + F, o.left = a, O("bottom") && (v = "tl"), o.left += d, C = a - Number(o.left) + Math.min(f / 2, 50), y.left = E(12, p.width - 12, C);
182
- break;
183
- case "br":
184
- o.top = m + c + F, o.left = a + f - p.width, O("bottom") && (v = "tr"), o.left += d, C = a - Number(o.left) + Math.max(f / 2, f - 50), y.left = E(12, p.width - 12, C);
185
- break;
186
- case "left": {
187
- o.top = c + m / 2 - p.height / 2, o.left = a - p.width - H, O("left") && (v = "right"), o.top += x, w = c - Number(o.top) + m / 2, y.top = E(12, p.height - 12, w);
188
- break;
189
- }
190
- case "lt":
191
- o.top = c, o.left = a - p.width - H, O("left") && (v = "rt"), o.top += x, w = c - Number(o.top) + Math.min(m / 2, 50), y.top = E(12, p.height - 12, w);
192
- break;
193
- case "lb":
194
- o.top = c + m - p.height, o.left = a - p.width - H, O("left") && (v = "rb"), o.top += x, w = c - Number(o.top) + Math.max(m / 2, m - 50), y.top = E(12, p.height - 12, w);
195
- break;
196
- case "right": {
197
- o.top = c + m / 2 - p.height / 2, o.left = f + a + N, O("right") && (v = "left"), o.top += x, w = c - Number(o.top) + m / 2, y.top = E(12, p.height - 12, w);
198
- break;
199
- }
200
- case "rt":
201
- o.top = c, o.left = f + a + N, O("right") && (v = "lt"), o.top += x, w = c - Number(o.top) + Math.min(m / 2, 50), y.top = E(12, p.height - 12, w);
202
- break;
203
- case "rb":
204
- o.top = c + m - p.height, o.left = f + a + N, O("right") && (v = "lb"), o.top += x, w = c - Number(o.top) + Math.max(m / 2, m - 50), y.top = E(12, p.height - 12, w);
205
- break;
206
- }
28
+ const { width: e, height: t, left: s, right: o } = ge(u, h);
207
29
  return {
208
- style: o,
209
- arrowStyle: y,
210
- realPosition: v
211
- };
212
- };
213
- function J(h, l) {
214
- if (!h)
215
- return {};
216
- const { width: t, height: e, left: i, right: r } = I(h, l);
217
- return {
218
- width: t,
219
- height: e,
220
- left: i,
221
- right: r
30
+ width: e,
31
+ height: t,
32
+ left: s,
33
+ right: o
222
34
  };
223
35
  }
224
- const Kt = [
36
+ const We = [
225
37
  "onClick",
226
38
  "onMouseEnter",
227
39
  "onMouseLeave",
@@ -231,13 +43,13 @@ const Kt = [
231
43
  "onContextMenu",
232
44
  "onKeyDown"
233
45
  ];
234
- function Et(h, l) {
235
- const t = {}, e = { ...h };
236
- return l.forEach((i) => {
237
- h && i in h && (t[i] = h[i], delete e[i]);
238
- }), { picked: t, omitted: e };
46
+ function me(u, h) {
47
+ const e = {}, t = { ...u };
48
+ return h.forEach((s) => {
49
+ u && s in u && (e[s] = u[s], delete t[s]);
50
+ }), { picked: e, omitted: t };
239
51
  }
240
- const xt = {
52
+ const Pe = {
241
53
  blurToHide: !0,
242
54
  // clickToClose: true,
243
55
  classNames: "fadeIn",
@@ -257,170 +69,212 @@ const xt = {
257
69
  mouseLeaveDelay: 100,
258
70
  autoFitPosition: !0
259
71
  };
260
- class Z extends ht {
261
- constructor(t, e) {
262
- super(t, e);
263
- s(this, "context");
264
- s(this, "popupContainer");
265
- s(this, "refTrigger");
266
- s(this, "delayTimer", null);
267
- s(this, "updatePositionTimer", null);
72
+ class W extends se {
73
+ constructor(e, t) {
74
+ super(e, t);
75
+ i(this, "context");
76
+ i(this, "popupContainer");
77
+ i(this, "rootElementRef");
78
+ i(this, "triggerRef", H());
79
+ // 标志 popup 是否被销毁
80
+ i(this, "triggerRefDestoried");
81
+ i(this, "delayTimer", null);
82
+ i(this, "updatePositionTimer", null);
268
83
  // popup 真正出现的位置
269
- s(this, "realPosition");
84
+ i(this, "realPosition");
270
85
  // arrow 箭头的位置
271
- s(this, "arrowStyle");
86
+ i(this, "arrowStyle");
272
87
  // is popup open?
273
- s(this, "popupOpen", !1);
88
+ i(this, "popupOpen", !1);
274
89
  // if mousedown to hide popup, ignore onFocus
275
- s(this, "mousedownToHide", !1);
276
- s(this, "mouseDownTimeout");
277
- s(this, "hasPopupMouseDown", !1);
90
+ i(this, "mousedownToHide", !1);
91
+ i(this, "mouseDownTimeout");
92
+ i(this, "hasPopupMouseDown", !1);
278
93
  // handle click outside document
279
- s(this, "handleClickOutside");
94
+ i(this, "handleClickOutside");
280
95
  // 是否监听了window 的resize
281
- s(this, "handleWindowResize");
282
- s(this, "unmount", !1);
283
- s(this, "isDidMount", !1);
96
+ i(this, "handleWindowResize");
97
+ i(this, "unmount", !1);
98
+ i(this, "isDidMount", !1);
284
99
  // 保存鼠标的位置
285
- s(this, "mouseLocation", {
100
+ i(this, "mouseLocation", {
286
101
  clientX: 0,
287
102
  clientY: 0
288
103
  });
289
104
  // 保存当前的mount container dom元素
290
- s(this, "observerContainer", null);
105
+ i(this, "observerContainer", null);
291
106
  // 保存当前节点到 popupContainer 间的所有滚动元素
292
- s(this, "scrollElements", null);
107
+ i(this, "scrollElements", null);
293
108
  // container 触发 resize时执行
294
- s(this, "resizeObserver", new ResizeObserver(() => {
109
+ i(this, "resizeObserver", new ResizeObserver(() => {
295
110
  window.requestAnimationFrame(this.handleUpdatePosition);
296
111
  }));
297
- s(this, "resizeObserver2", null);
298
- s(this, "resizeObserver3", null);
299
- s(this, "childrenDom", null);
112
+ i(this, "resizeObserver2", new ResizeObserver(() => {
113
+ window.requestAnimationFrame(() => {
114
+ const e = this.triggerRef.current;
115
+ if (e) {
116
+ const t = this.getPopupStyle(), s = this.props.style || {};
117
+ e.style.top = String(s.top || `${t.top}px`), e.style.left = String(s.left || `${t.left}px`);
118
+ }
119
+ this.onResize();
120
+ });
121
+ }));
122
+ i(this, "onResizeObserver2", () => {
123
+ var t, s;
124
+ this.offResizeObserver2();
125
+ let e = this.getPopupElement();
126
+ e && ((s = (t = this.resizeObserver2) == null ? void 0 : t.observe) == null || s.call(t, e));
127
+ });
128
+ i(this, "offResizeObserver2", () => {
129
+ var t, s;
130
+ let e = this.getPopupElement();
131
+ e && ((s = (t = this.resizeObserver2) == null ? void 0 : t.unobserve) == null || s.call(t, e));
132
+ });
133
+ i(this, "resizeObserver3", new ResizeObserver(() => {
134
+ window.requestAnimationFrame(this.onResize);
135
+ }));
136
+ i(this, "onResizeObserver3", () => {
137
+ var t, s;
138
+ this.offResizeObserver3();
139
+ let e = this.getRootElement();
140
+ e && ((s = (t = this.resizeObserver3) == null ? void 0 : t.observe) == null || s.call(t, e));
141
+ });
142
+ i(this, "offResizeObserver3", () => {
143
+ var t, s;
144
+ let e = this.getRootElement();
145
+ e && ((s = (t = this.resizeObserver3) == null ? void 0 : t.unobserve) == null || s.call(t, e));
146
+ });
147
+ i(this, "childrenDom", null);
300
148
  // 保存children节点的尺寸。 主要用于在弹出层动画前和动画完成后比较尺寸是否有变化。
301
- s(this, "childrenDomSize", {});
302
- s(this, "getMergedProps", (t) => {
303
- const { componentConfig: e } = this.context ?? {};
304
- return gt(
305
- t && q(t) ? t : this.props,
306
- xt,
307
- e == null ? void 0 : e.Trigger,
308
- t && rt(t) ? t : void 0
149
+ i(this, "childrenDomSize", {});
150
+ i(this, "getMergedProps", (e) => {
151
+ const { componentConfig: t } = this.context ?? {};
152
+ return pe(
153
+ e && L(e) ? e : this.props,
154
+ Pe,
155
+ t == null ? void 0 : t.Trigger,
156
+ e && te(e) ? e : void 0
309
157
  );
310
158
  });
311
- s(this, "getRootElement", () => (this.childrenDom = at(this), this.childrenDom));
312
- s(this, "offScrollListeners", () => {
313
- (this.scrollElements || []).forEach((t) => {
314
- Y(t, "scroll", this.handleScroll);
159
+ i(this, "getRootElement", () => {
160
+ var e, t;
161
+ return this.childrenDom = he(
162
+ ((t = (e = this.props).getTargetDOMNode) == null ? void 0 : t.call(e)) || this.rootElementRef,
163
+ this
164
+ ), this.childrenDom;
165
+ });
166
+ i(this, "getPopupElement", () => this.triggerRef.current || null);
167
+ i(this, "offScrollListeners", () => {
168
+ (this.scrollElements || []).forEach((e) => {
169
+ R(e, "scroll", this.handleScroll);
315
170
  }), this.scrollElements = null;
316
171
  });
317
- s(this, "offWindowResize", () => {
318
- this.handleWindowResize = !1, Y(window, "resize", this.handleUpdatePosition);
172
+ i(this, "offWindowResize", () => {
173
+ this.handleWindowResize = !1, R(window, "resize", this.handleUpdatePosition);
319
174
  });
320
- s(this, "offContainerResize", () => {
175
+ i(this, "offContainerResize", () => {
321
176
  this.resizeObserver && this.observerContainer && (this.resizeObserver.unobserve(this.observerContainer), this.observerContainer = null);
322
177
  });
323
- s(this, "handleScroll", () => {
324
- const t = this.getMergedProps([
178
+ i(this, "handleScroll", () => {
179
+ const e = this.getMergedProps([
325
180
  "containerScrollToClose",
326
181
  "updateOnScroll"
327
182
  ]);
328
- t.containerScrollToClose ? this.setPopupVisible(!1) : t.updateOnScroll && this.handleUpdatePosition();
183
+ e.containerScrollToClose ? this.setPopupVisible(!1) : e.updateOnScroll && this.handleUpdatePosition();
329
184
  });
330
- s(this, "onContainersScroll", (t) => {
331
- var e, i;
332
- this.scrollElements || (this.scrollElements = ft(
185
+ i(this, "onContainersScroll", (e) => {
186
+ var t, s;
187
+ this.scrollElements || (this.scrollElements = oe(
333
188
  this.childrenDom,
334
- (e = this.popupContainer) == null ? void 0 : e.parentNode
335
- ), t.containerScrollToClose && ((i = this.popupContainer) == null ? void 0 : i.parentNode) === document.body && this.scrollElements.indexOf(document.body) === -1 && dt(document.documentElement) && this.scrollElements.push(window), this.scrollElements.forEach((r) => {
336
- U(r, "scroll", this.handleScroll);
189
+ (t = this.popupContainer) == null ? void 0 : t.parentNode
190
+ ), e.containerScrollToClose && ((s = this.popupContainer) == null ? void 0 : s.parentNode) === document.body && this.scrollElements.indexOf(document.body) === -1 && re(document.documentElement) && this.scrollElements.push(window), this.scrollElements.forEach((o) => {
191
+ w(o, "scroll", this.handleScroll);
337
192
  }));
338
193
  });
339
- s(this, "onContainerResize", () => {
340
- var e;
341
- const t = (e = this.popupContainer) == null ? void 0 : e.parentNode;
342
- this.resizeObserver && this.observerContainer !== t && (this.offContainerResize(), t && this.resizeObserver.observe(t), this.observerContainer = t);
194
+ i(this, "onContainerResize", () => {
195
+ var t;
196
+ const e = (t = this.popupContainer) == null ? void 0 : t.parentNode;
197
+ this.resizeObserver && this.observerContainer !== e && (this.offContainerResize(), e && this.resizeObserver.observe(e), this.observerContainer = e);
343
198
  });
344
199
  // getPopupContainer 改变时候触发
345
- s(this, "handleUpdatePosition", j(() => {
200
+ i(this, "handleUpdatePosition", F(() => {
346
201
  this.updatePopupPosition();
347
202
  }));
348
- s(this, "isClickTrigger", () => {
349
- const { trigger: t } = this.getMergedProps(["trigger"]);
350
- return [].concat(t).indexOf("click") > -1;
203
+ i(this, "isClickTrigger", () => {
204
+ const { trigger: e } = this.getMergedProps(["trigger"]);
205
+ return [].concat(e).indexOf("click") > -1;
351
206
  });
352
- s(this, "isFocusTrigger", () => {
353
- const { trigger: t } = this.getMergedProps(["trigger"]);
354
- return [].concat(t).indexOf("focus") > -1;
207
+ i(this, "isFocusTrigger", () => {
208
+ const { trigger: e } = this.getMergedProps(["trigger"]);
209
+ return [].concat(e).indexOf("focus") > -1;
355
210
  });
356
- s(this, "isHoverTrigger", () => {
357
- const { trigger: t } = this.getMergedProps(["trigger"]);
358
- return [].concat(t).indexOf("hover") > -1;
211
+ i(this, "isHoverTrigger", () => {
212
+ const { trigger: e } = this.getMergedProps(["trigger"]);
213
+ return [].concat(e).indexOf("hover") > -1;
359
214
  });
360
- s(this, "isContextMenuTrigger", () => {
361
- const { trigger: t } = this.getMergedProps(["trigger"]);
362
- return [].concat(t).indexOf("contextMenu") > -1;
215
+ i(this, "isContextMenuTrigger", () => {
216
+ const { trigger: e } = this.getMergedProps(["trigger"]);
217
+ return [].concat(e).indexOf("contextMenu") > -1;
363
218
  });
364
219
  // 是否在鼠标移出触发节点和popup的时候隐藏弹出层
365
- s(this, "isMouseLeaveToClose", () => this.isHoverTrigger() && this.getMergedProps(["mouseLeaveToClose"]).mouseLeaveToClose);
220
+ i(this, "isMouseLeaveToClose", () => this.isHoverTrigger() && this.getMergedProps(["mouseLeaveToClose"]).mouseLeaveToClose);
366
221
  // 是否在悬浮到popup的时候隐藏弹出层
367
- s(this, "isPopupHoverHide", () => this.isHoverTrigger() && !this.getMergedProps(["popupHoverStay"]).popupHoverStay);
368
- s(this, "isClickToHide", () => {
222
+ i(this, "isPopupHoverHide", () => this.isHoverTrigger() && !this.getMergedProps(["popupHoverStay"]).popupHoverStay);
223
+ i(this, "isClickToHide", () => {
369
224
  if (this.isClickTrigger() || this.isContextMenuTrigger()) {
370
- const { clickToClose: t = !0 } = this.getMergedProps(["clickToClose"]);
371
- return t;
225
+ const { clickToClose: e = !0 } = this.getMergedProps(["clickToClose"]);
226
+ return e;
372
227
  }
373
228
  return this.isHoverTrigger() && this.props.clickToClose;
374
229
  });
375
- s(this, "isBlurToHide", () => this.isFocusTrigger() && this.getMergedProps(["blurToHide"]).blurToHide);
376
- s(this, "clearTimer", () => {
230
+ i(this, "isBlurToHide", () => this.isFocusTrigger() && this.getMergedProps(["blurToHide"]).blurToHide);
231
+ i(this, "clearTimer", () => {
377
232
  this.updatePositionTimer && (this.updatePositionTimer.cancel ? this.updatePositionTimer.cancel() : (clearTimeout(this.updatePositionTimer), this.updatePositionTimer = null)), this.delayTimer && (clearTimeout(this.delayTimer), this.delayTimer = null), this.mouseDownTimeout && (clearTimeout(this.mouseDownTimeout), this.mouseDownTimeout = null);
378
233
  });
379
- s(this, "offClickOutside", () => {
234
+ i(this, "offClickOutside", () => {
380
235
  if (this.handleClickOutside) {
381
- const { getDocument: t } = this.getMergedProps(["getDocument"]), e = W(t) && t();
382
- Y(e, "mousedown", this.onClickOutside), this.handleClickOutside = !1;
236
+ const { getDocument: e } = this.getMergedProps(["getDocument"]), t = g(e) && e();
237
+ R(t, "mousedown", this.onClickOutside), this.handleClickOutside = !1;
383
238
  }
384
239
  });
385
- s(this, "getTransformOrigin", (t) => {
386
- var o, M;
387
- const e = this.refTrigger;
388
- if (!e)
389
- return {};
390
- const { showArrow: i, classNames: r } = this.getMergedProps([
240
+ i(this, "getTransformOrigin", (e) => {
241
+ var T, f;
242
+ const t = this.getPopupElement();
243
+ if (!t) return {};
244
+ const { showArrow: s, classNames: o } = this.getMergedProps([
391
245
  "showArrow",
392
246
  "classNames"
393
247
  ]);
394
- let n = i && ((o = this.arrowStyle) == null ? void 0 : o.top) || 0, u = i && ((M = this.arrowStyle) == null ? void 0 : M.left) || 0;
395
- n = n ? `${n}px` : "", u = u ? `${u}px` : "";
396
- const P = {
397
- top: `${u || "50%"} 100% 0`,
398
- tl: `${u || "15px"} 100% 0`,
399
- tr: `${u || `${e.clientWidth - 15}px`} 100% 0`,
400
- bottom: `${u || "50%"} 0 0`,
401
- bl: `${u || "15px"} 0 0`,
402
- br: `${u || `${e.clientWidth - 15}px`} 0 0`,
403
- left: `100% ${n || "50%"} 0`,
404
- lt: `100% ${n || "15px"} 0`,
405
- lb: `100% ${n || `${e.clientHeight - 15}px`} 0`,
406
- right: `0 ${n || "50%"} 0`,
407
- rt: `0 ${n || "15px"} 0`,
408
- rb: `0 ${n || `${e.clientHeight - 15}px`} 0`
248
+ let r = s && ((T = this.arrowStyle) == null ? void 0 : T.top) || 0, n = s && ((f = this.arrowStyle) == null ? void 0 : f.left) || 0;
249
+ r = r ? `${r}px` : "", n = n ? `${n}px` : "";
250
+ const a = {
251
+ top: `${n || "50%"} 100% 0`,
252
+ tl: `${n || "15px"} 100% 0`,
253
+ tr: `${n || `${t.clientWidth - 15}px`} 100% 0`,
254
+ bottom: `${n || "50%"} 0 0`,
255
+ bl: `${n || "15px"} 0 0`,
256
+ br: `${n || `${t.clientWidth - 15}px`} 0 0`,
257
+ left: `100% ${r || "50%"} 0`,
258
+ lt: `100% ${r || "15px"} 0`,
259
+ lb: `100% ${r || `${t.clientHeight - 15}px`} 0`,
260
+ right: `0 ${r || "50%"} 0`,
261
+ rt: `0 ${r || "15px"} 0`,
262
+ rb: `0 ${r || `${t.clientHeight - 15}px`} 0`
409
263
  };
410
- if (r && r.indexOf("zoom") > -1)
264
+ if (o && o.indexOf("zoom") > -1)
411
265
  return {
412
- transformOrigin: P[t]
266
+ transformOrigin: a[e]
413
267
  };
414
- if (r === "slideDynamicOrigin") {
415
- let g = "0% 0%";
416
- return ["top", "tl", "tr"].indexOf(t) > -1 && (g = "100% 100%"), {
417
- transformOrigin: g
268
+ if (o === "slideDynamicOrigin") {
269
+ let v = "0% 0%";
270
+ return ["top", "tl", "tr"].indexOf(e) > -1 && (v = "100% 100%"), {
271
+ transformOrigin: v
418
272
  };
419
273
  }
420
274
  return {};
421
275
  });
422
276
  // 下拉框存在初始translateY/translateX,需要根据真实的弹出位置确定
423
- s(this, "getTransformTranslate", () => {
277
+ i(this, "getTransformTranslate", () => {
424
278
  if (this.getMergedProps(["classNames"]).classNames !== "slideDynamicOrigin")
425
279
  return "";
426
280
  switch (this.realPosition) {
@@ -436,171 +290,172 @@ class Z extends ht {
436
290
  return "";
437
291
  }
438
292
  });
439
- s(this, "getPopupStyle", () => {
293
+ i(this, "getPopupStyle", () => {
440
294
  if (this.unmount || !this.popupContainer)
441
295
  return;
442
- const t = this.popupContainer, e = this.refTrigger, i = this.getRootElement();
443
- if (!i.offsetParent && !i.getClientRects().length)
296
+ const e = this.popupContainer, t = this.triggerRef.current, s = this.getRootElement();
297
+ if (!s.offsetParent && !s.getClientRects().length)
444
298
  return this.state.popupStyle;
445
- const r = this.getMergedProps(), { style: n, arrowStyle: u, realPosition: P } = Dt(
446
- r,
447
- e,
448
- i,
299
+ const o = this.getMergedProps(), { style: r, arrowStyle: n, realPosition: a } = de(
300
+ o,
449
301
  t,
302
+ s,
303
+ e,
450
304
  this.mouseLocation
451
305
  );
452
- return this.realPosition = P || r.position, this.arrowStyle = u || {}, {
453
- ...n,
306
+ return this.realPosition = a || o.position, this.arrowStyle = n || {}, {
307
+ ...r,
454
308
  ...this.getTransformOrigin(this.realPosition)
455
309
  };
456
310
  });
457
- s(this, "showPopup", (t = () => {
311
+ i(this, "showPopup", (e = () => {
458
312
  }) => {
459
- const e = this.getPopupStyle();
313
+ const t = this.getPopupStyle();
460
314
  this.setState(
461
315
  {
462
- popupStyle: e
316
+ popupStyle: t
463
317
  },
464
- t
318
+ e
465
319
  );
466
320
  });
467
- s(this, "update", j((t) => {
321
+ i(this, "update", F((e) => {
468
322
  if (this.unmount || !this.state.popupVisible)
469
323
  return;
470
- const e = this.getPopupStyle();
324
+ const t = this.getPopupStyle();
471
325
  this.setState(
472
326
  {
473
- popupStyle: e
327
+ popupStyle: t
474
328
  },
475
329
  () => {
476
- t == null || t();
330
+ e == null || e();
477
331
  }
478
332
  );
479
333
  }));
480
- s(this, "updatePopupPosition", (t = 0, e) => {
334
+ i(this, "getRootDOMNode", () => this.getRootElement());
335
+ i(this, "updatePopupPosition", (e = 0, t) => {
481
336
  if (this.state.popupVisible) {
482
- if (t < 4) {
483
- this.updatePositionTimer = this.update(e);
337
+ if (e < 4) {
338
+ this.updatePositionTimer = this.update(t);
484
339
  return;
485
340
  }
486
341
  this.updatePositionTimer = setTimeout(() => {
487
- const r = this.getPopupStyle();
342
+ const o = this.getPopupStyle();
488
343
  this.setState(
489
344
  {
490
- popupStyle: r
345
+ popupStyle: o
491
346
  },
492
347
  () => {
493
- e == null || e();
348
+ t == null || t();
494
349
  }
495
350
  );
496
- }, t);
351
+ }, e);
497
352
  }
498
353
  });
499
- s(this, "setPopupVisible", (t, e = 0, i) => {
500
- const r = this.getMergedProps([
354
+ i(this, "setPopupVisible", (e, t = 0, s) => {
355
+ const o = this.getMergedProps([
501
356
  "onVisibleChange",
502
357
  "popupVisible"
503
- ]), { onVisibleChange: n } = r, u = this.state.popupVisible;
504
- t !== u ? this.delayToDo(e, () => {
505
- n == null || n(t), "popupVisible" in r ? i == null || i() : t ? this.setState(
358
+ ]), { onVisibleChange: r } = o, n = this.state.popupVisible;
359
+ e !== n ? this.delayToDo(t, () => {
360
+ r == null || r(e), "popupVisible" in o ? s == null || s() : e ? this.setState(
506
361
  {
507
362
  popupVisible: !0
508
363
  },
509
364
  () => {
510
- this.showPopup(i);
365
+ this.showPopup(s);
511
366
  }
512
367
  ) : this.setState(
513
368
  {
514
369
  popupVisible: !1
515
370
  },
516
371
  () => {
517
- i == null || i();
372
+ s == null || s();
518
373
  }
519
374
  );
520
- }) : i == null || i();
375
+ }) : s == null || s();
521
376
  });
522
- s(this, "delayToDo", (t, e) => {
523
- t ? (this.clearDelayTimer(), this.delayTimer = setTimeout(() => {
524
- e(), this.clearDelayTimer();
525
- }, t)) : e();
377
+ i(this, "delayToDo", (e, t) => {
378
+ e ? (this.clearDelayTimer(), this.delayTimer = setTimeout(() => {
379
+ t(), this.clearDelayTimer();
380
+ }, e)) : t();
526
381
  });
527
382
  // 点击非popup内部,非children内部的节点,触发clickoutside 逻辑
528
- s(this, "onClickOutside", (t) => {
529
- const { onClickOutside: e, clickOutsideToClose: i } = this.getMergedProps([
383
+ i(this, "onClickOutside", (e) => {
384
+ const { onClickOutside: t, clickOutsideToClose: s } = this.getMergedProps([
530
385
  "onClickOutside",
531
386
  "clickOutsideToClose"
532
- ]), r = this.refTrigger, n = this.getRootElement();
533
- !Q(r, t.target) && !Q(n, t.target) && !this.hasPopupMouseDown && (e == null || e(), i && !this.isBlurToHide() && !this.isHoverTrigger() && this.setPopupVisible(!1));
387
+ ]), o = this.getPopupElement(), r = this.getRootElement();
388
+ !$(o, e.target) && !$(r, e.target) && !this.hasPopupMouseDown && (t == null || t(), s && !this.isBlurToHide() && !this.isHoverTrigger() && this.setPopupVisible(!1));
534
389
  });
535
- s(this, "onKeyDown", (t) => {
536
- const e = t.key;
537
- this.triggerPropsEvent("onKeyDown", t), e === K.key && this.onPressEsc(t);
390
+ i(this, "onKeyDown", (e) => {
391
+ const t = e.key;
392
+ this.triggerPropsEvent("onKeyDown", e), t === N.key && this.onPressEsc(e);
538
393
  });
539
- s(this, "onPressEsc", (t) => {
540
- const { escToClose: e } = this.getMergedProps(["escToClose"]), i = t.key;
541
- e && t && i === K.key && this.state.popupVisible && this.setPopupVisible(!1);
394
+ i(this, "onPressEsc", (e) => {
395
+ const { escToClose: t } = this.getMergedProps(["escToClose"]);
396
+ t && e && e.key === N.key && this.state.popupVisible && this.setPopupVisible(!1);
542
397
  });
543
- s(this, "onMouseEnter", (t) => {
544
- const { mouseEnterDelay: e } = this.getMergedProps(["mouseEnterDelay"]);
545
- this.triggerPropsEvent("onMouseEnter", t), this.clearDelayTimer(), this.setPopupVisible(!0, e || 0);
398
+ i(this, "onMouseEnter", (e) => {
399
+ const { mouseEnterDelay: t } = this.getMergedProps(["mouseEnterDelay"]);
400
+ this.triggerPropsEvent("onMouseEnter", e), this.clearDelayTimer(), this.setPopupVisible(!0, t || 0);
546
401
  });
547
- s(this, "onMouseMove", (t) => {
548
- this.triggerPropsEvent("onMouseMove", t), this.setMouseLocation(t), this.state.popupVisible && this.update();
402
+ i(this, "onMouseMove", (e) => {
403
+ this.triggerPropsEvent("onMouseMove", e), this.setMouseLocation(e), this.state.popupVisible && this.update();
549
404
  });
550
- s(this, "onMouseLeave", (t) => {
551
- const { mouseLeaveDelay: e } = this.getMergedProps(["mouseLeaveDelay"]);
552
- this.clearDelayTimer(), this.triggerPropsEvent("onMouseLeave", t), this.isMouseLeaveToClose() && this.state.popupVisible && this.setPopupVisible(!1, e || 0);
405
+ i(this, "onMouseLeave", (e) => {
406
+ const { mouseLeaveDelay: t } = this.getMergedProps(["mouseLeaveDelay"]);
407
+ this.clearDelayTimer(), this.triggerPropsEvent("onMouseLeave", e), this.isMouseLeaveToClose() && this.state.popupVisible && this.setPopupVisible(!1, t || 0);
553
408
  });
554
- s(this, "onPopupMouseEnter", () => {
409
+ i(this, "onPopupMouseEnter", () => {
555
410
  this.clearDelayTimer();
556
411
  });
557
- s(this, "onPopupMouseLeave", (t) => {
558
- this.onMouseLeave(t);
412
+ i(this, "onPopupMouseLeave", (e) => {
413
+ this.onMouseLeave(e);
559
414
  });
560
- s(this, "setMouseLocation", (t) => {
415
+ i(this, "setMouseLocation", (e) => {
561
416
  this.getMergedProps(["alignPoint"]).alignPoint && (this.mouseLocation = {
562
- clientX: t.clientX,
563
- clientY: t.clientY
417
+ clientX: e.clientX,
418
+ clientY: e.clientY
564
419
  });
565
420
  });
566
- s(this, "onContextMenu", (t) => {
567
- t.preventDefault(), this.triggerPropsEvent("onContextMenu", t), this.setMouseLocation(t), this.state.popupVisible ? this.getMergedProps(["alignPoint"]).alignPoint && this.update() : this.setPopupVisible(!0, 0);
421
+ i(this, "onContextMenu", (e) => {
422
+ e.preventDefault(), this.triggerPropsEvent("onContextMenu", e), this.setMouseLocation(e), this.state.popupVisible ? this.getMergedProps(["alignPoint"]).alignPoint && this.update() : this.setPopupVisible(!0, 0);
568
423
  });
569
- s(this, "clickToHidePopup", (t) => {
570
- const { popupVisible: e } = this.state;
571
- e && (this.mousedownToHide = !0), this.triggerPropsEvent("onClick", t), this.isClickToHide() && e && this.setPopupVisible(!e, 0);
424
+ i(this, "clickToHidePopup", (e) => {
425
+ const { popupVisible: t } = this.state;
426
+ t && (this.mousedownToHide = !0), this.triggerPropsEvent("onClick", e), this.isClickToHide() && t && this.setPopupVisible(!t, 0);
572
427
  });
573
- s(this, "onClick", (t) => {
574
- const { popupVisible: e } = this.state;
575
- e && (this.mousedownToHide = !0), this.triggerPropsEvent("onClick", t), this.setMouseLocation(t), !(!this.isClickToHide() && e) && this.setPopupVisible(!e, 0);
428
+ i(this, "onClick", (e) => {
429
+ const { popupVisible: t } = this.state;
430
+ t && (this.mousedownToHide = !0), this.triggerPropsEvent("onClick", e), this.setMouseLocation(e), !(!this.isClickToHide() && t) && this.setPopupVisible(!t, 0);
576
431
  });
577
- s(this, "onFocus", (t) => {
578
- const { focusDelay: e } = this.getMergedProps(["focusDelay"]), i = () => {
579
- this.triggerPropsEvent("onFocus", t);
432
+ i(this, "onFocus", (e) => {
433
+ const { focusDelay: t } = this.getMergedProps(["focusDelay"]), s = () => {
434
+ this.triggerPropsEvent("onFocus", e);
580
435
  };
581
- this.clearDelayTimer(), this.mousedownToHide || (this.state.popupVisible ? i == null || i() : this.setPopupVisible(!0, e || 0, i)), this.mousedownToHide = !1;
436
+ this.clearDelayTimer(), this.mousedownToHide || (this.state.popupVisible ? s == null || s() : this.setPopupVisible(!0, t || 0, s)), this.mousedownToHide = !1;
582
437
  });
583
- s(this, "onBlur", (t) => {
584
- this.setPopupVisible(!1, 200, () => this.triggerPropsEvent("onBlur", t));
438
+ i(this, "onBlur", (e) => {
439
+ this.setPopupVisible(!1, 200, () => this.triggerPropsEvent("onBlur", e));
585
440
  });
586
- s(this, "onResize", () => {
441
+ i(this, "onResize", () => {
587
442
  this.getMergedProps(["autoFixPosition"]).autoFixPosition && this.state.popupVisible && this.updatePopupPosition();
588
443
  });
589
- s(this, "onPopupMouseDown", () => {
444
+ i(this, "onPopupMouseDown", () => {
590
445
  this.hasPopupMouseDown = !0, clearTimeout(this.mouseDownTimeout), this.mouseDownTimeout = setTimeout(() => {
591
446
  this.hasPopupMouseDown = !1;
592
447
  }, 0);
593
448
  });
594
449
  // 当 children 中的元素 disabled 时,不能正确触发 hover 等事件,所以当监测到对应
595
450
  // 组件有 disabled 时,给元素加一层 span,处理事件,模拟样式
596
- s(this, "getChild", () => {
597
- var n;
598
- const { children: t } = this.props, e = t, i = e && typeof e != "string" && e.type;
599
- let r = t;
600
- if (["string", "number"].indexOf(typeof t) > -1 || A.Children.count(t) > 1)
601
- r = /* @__PURE__ */ R("span", { children: t });
602
- else if (e && i && (i.__PQB_BUTTON === !0 || i.__PQB_CHECKBOX === !0 || i.__PQB_SWITCH === !0 || i.__PQB_RADIO === !0 || i === "button") && e.props.disabled) {
603
- const { picked: u, omitted: P } = Et(e.props.style, [
451
+ i(this, "getChild", () => {
452
+ var r;
453
+ const { children: e } = this.props, t = e, s = t && typeof t != "string" && t.type;
454
+ let o = e;
455
+ if (["string", "number"].indexOf(typeof e) > -1 || C.Children.count(e) > 1)
456
+ o = /* @__PURE__ */ d("span", { children: e });
457
+ else if (t && s && (s.__PQB_BUTTON === !0 || s.__PQB_CHECKBOX === !0 || s.__PQB_SWITCH === !0 || s.__PQB_RADIO === !0 || s === "button") && t.props.disabled) {
458
+ const { picked: n, omitted: a } = me(t.props.style, [
604
459
  "position",
605
460
  "left",
606
461
  "right",
@@ -610,14 +465,14 @@ class Z extends ht {
610
465
  "display",
611
466
  "zIndex"
612
467
  ]);
613
- r = /* @__PURE__ */ R(
468
+ o = /* @__PURE__ */ d(
614
469
  "span",
615
470
  {
616
- className: (n = e.props) == null ? void 0 : n.className,
617
- style: { display: "inline-block", ...u, cursor: "not-allowed" },
618
- children: A.cloneElement(e, {
471
+ className: (r = t.props) == null ? void 0 : r.className,
472
+ style: { display: "inline-block", ...n, cursor: "not-allowed" },
473
+ children: C.cloneElement(t, {
619
474
  style: {
620
- ...P,
475
+ ...a,
621
476
  pointerEvents: "none"
622
477
  },
623
478
  className: void 0
@@ -625,217 +480,198 @@ class Z extends ht {
625
480
  }
626
481
  );
627
482
  }
628
- return r || /* @__PURE__ */ R("span", {});
483
+ return o || /* @__PURE__ */ d("span", {});
629
484
  });
630
- s(this, "rafId");
485
+ i(this, "rafId");
631
486
  // 创建的dom节点插入getPopupContainer。
632
- s(this, "appendToContainer", (t) => {
633
- if (G(this.rafId), this.isDidMount) {
634
- const { getPopupContainer: e } = this.context, { getPopupContainer: i } = this.getMergedProps(["getPopupContainer"]), r = i || e, n = this.getRootElement(), u = r == null ? void 0 : r(n);
635
- if (u) {
636
- u.appendChild(t);
487
+ i(this, "appendToContainer", (e) => {
488
+ if (k(this.rafId), this.isDidMount) {
489
+ const { getPopupContainer: t } = this.context, { getPopupContainer: s } = this.getMergedProps(["getPopupContainer"]), o = s || t, r = this.getRootElement(), n = o == null ? void 0 : o(r);
490
+ if (n) {
491
+ n.appendChild(e);
637
492
  return;
638
493
  }
639
494
  }
640
- this.rafId = bt(() => {
641
- this.appendToContainer(t);
495
+ this.rafId = ue(() => {
496
+ this.appendToContainer(e);
642
497
  });
643
498
  });
644
- s(this, "getContainer", () => {
645
- const t = document.createElement("div");
646
- return t.style.width = "100%", t.style.position = "absolute", t.style.top = "0", t.style.left = "0", this.popupContainer = t, this.appendToContainer(t), t;
499
+ i(this, "getContainer", () => {
500
+ const e = document.createElement("div");
501
+ return e.style.width = "100%", e.style.position = "absolute", e.style.top = "0", e.style.left = "0", this.popupContainer = e, this.appendToContainer(e), e;
647
502
  });
648
503
  // 1. 触发直接附加到 Trigger 上的事件,大多是Trigger直接嵌套Trigger的情况
649
504
  // 2. 触发children上直接被附加的事件
650
- s(this, "triggerPropsEvent", (t, e) => {
651
- const i = this.getChild(), r = i && i.props && i.props[t], n = this.getMergedProps([t])[t];
652
- W(r) && r(e), W(n) && n(e);
505
+ i(this, "triggerPropsEvent", (e, t) => {
506
+ const s = this.getChild(), o = s && s.props && s.props[e], r = this.getMergedProps([e])[e];
507
+ g(o) && o(t), g(r) && r(t);
653
508
  });
654
509
  // 触发 children/ trigger 组件上被附加的事件
655
- s(this, "triggerOriginEvent", (t) => {
656
- const e = this.getChild(), i = e && e.props && e.props[t], r = this.getMergedProps([t])[t];
657
- return W(r) && W(i) ? (n) => {
658
- i(n), r(n);
659
- } : i || r;
660
- });
661
- const i = this.getMergedProps(t), r = "popupVisible" in i ? i.popupVisible : i.defaultPopupVisible;
662
- this.popupOpen = !!r, this.state = {
663
- popupVisible: !!r,
510
+ i(this, "triggerOriginEvent", (e) => {
511
+ const t = this.getChild(), s = t && t.props && t.props[e], o = this.getMergedProps([e])[e];
512
+ return g(o) && g(s) ? (r) => {
513
+ s(r), o(r);
514
+ } : s || o;
515
+ });
516
+ const s = this.getMergedProps(e), o = "popupVisible" in s ? s.popupVisible : s.defaultPopupVisible;
517
+ this.popupOpen = !!o, this.triggerRef = H(), this.state = {
518
+ popupVisible: !!o,
664
519
  popupStyle: {}
665
520
  };
666
521
  }
667
- static getDerivedStateFromProps(t, e) {
668
- return "popupVisible" in t && t.popupVisible !== e.popupVisible ? {
669
- popupVisible: t.popupVisible
522
+ static getDerivedStateFromProps(e, t) {
523
+ return "popupVisible" in e && e.popupVisible !== t.popupVisible ? {
524
+ popupVisible: e.popupVisible
670
525
  } : null;
671
526
  }
672
- resizeObserver2Observe() {
673
- var t, e;
674
- this.refTrigger && (this.resizeObserver2 || (this.resizeObserver2Disconnect(), this.resizeObserver2 = new ResizeObserver(() => {
675
- window.requestAnimationFrame(() => {
676
- const i = this.refTrigger;
677
- if (i) {
678
- const r = this.getPopupStyle(), n = this.props.style || {};
679
- i.style.top = String(n.top || `${r.top}px`), i.style.left = String(n.left || `${r.left}px`);
680
- }
681
- this.onResize();
682
- });
683
- }), (e = (t = this.resizeObserver2) == null ? void 0 : t.observe) == null || e.call(t, this.refTrigger)));
684
- }
685
- resizeObserver2Disconnect() {
686
- var t, e;
687
- (e = (t = this.resizeObserver2) == null ? void 0 : t.disconnect) == null || e.call(t), this.resizeObserver2 = null;
688
- }
689
- resizeObserver3Observe() {
690
- var t, e;
691
- this.childrenDom && (this.resizeObserver3 || (this.resizeObserver3Disconnect(), this.resizeObserver3 = new ResizeObserver(() => {
692
- window.requestAnimationFrame(this.onResize);
693
- }), (e = (t = this.resizeObserver3) == null ? void 0 : t.observe) == null || e.call(t, this.childrenDom)));
694
- }
695
- resizeObserver3Disconnect() {
696
- var t, e;
697
- (e = (t = this.resizeObserver3) == null ? void 0 : t.disconnect) == null || e.call(t), this.resizeObserver3 = null;
698
- }
699
527
  componentDidMount() {
700
- this.componentDidUpdate(this.getMergedProps()), this.isDidMount = !0, this.unmount = !1, this.childrenDom = this.getRootElement(), this.state.popupVisible && (this.childrenDomSize = J(this.childrenDom, {
528
+ this.componentDidUpdate(this.getMergedProps()), this.isDidMount = !0, this.unmount = !1, this.childrenDom = this.getRootElement(), this.state.popupVisible && (this.childrenDomSize = B(this.childrenDom, {
701
529
  boundaryDistance: this.props.alignPoint ? void 0 : this.props.boundaryDistance,
702
530
  position: this.props.position
703
531
  }));
704
532
  }
705
- componentDidUpdate(t) {
706
- this.resizeObserver3Observe();
707
- const e = this.getMergedProps(t), i = this.getMergedProps();
708
- !e.popupVisible && i.popupVisible && this.update();
709
- const { popupVisible: r } = this.state;
710
- this.popupOpen = r;
711
- const { getDocument: n } = i;
712
- if (!r) {
713
- this.offClickOutside(), this.offContainerResize(), this.offWindowResize(), this.offScrollListeners();
533
+ componentDidUpdate(e) {
534
+ const t = this.getMergedProps(e), s = this.getMergedProps();
535
+ !t.popupVisible && s.popupVisible && this.update();
536
+ const { popupVisible: o } = this.state;
537
+ this.popupOpen = o;
538
+ const { getDocument: r } = s;
539
+ if (!o) {
540
+ this.offClickOutside(), this.offContainerResize(), this.offWindowResize(), this.offScrollListeners(), this.offResizeObserver2(), this.offResizeObserver3();
714
541
  return;
715
542
  }
716
- const u = J(this.childrenDom, {
543
+ const n = B(this.childrenDom, {
717
544
  boundaryDistance: this.props.alignPoint ? {} : this.props.boundaryDistance,
718
545
  position: this.props.position
719
546
  });
720
- if (nt(u, this.childrenDomSize) || (this.updatePopupPosition(), this.childrenDomSize = u), this.onContainerResize(), (i.updateOnScroll || i.containerScrollToClose) && this.onContainersScroll(i), this.handleWindowResize || (U(window, "resize", this.handleUpdatePosition), this.handleWindowResize = !0), !this.handleClickOutside) {
721
- const P = W(n) && n();
722
- P && (U(P, "mousedown", this.onClickOutside, {
723
- capture: q(i.clickOutsideToClose) ? i.clickOutsideToClose.capture : !1
547
+ if (ie(n, this.childrenDomSize) || (this.updatePopupPosition(), this.childrenDomSize = n), this.onContainerResize(), (s.updateOnScroll || s.containerScrollToClose) && this.onContainersScroll(s), this.handleWindowResize || (w(window, "resize", this.handleUpdatePosition), this.handleWindowResize = !0), !this.handleClickOutside) {
548
+ const a = g(r) && r();
549
+ a && (w(a, "mousedown", this.onClickOutside, {
550
+ capture: L(s.clickOutsideToClose) ? s.clickOutsideToClose.capture : !1
724
551
  }), this.handleClickOutside = !0);
725
552
  }
553
+ this.onResizeObserver2(), this.onResizeObserver3();
726
554
  }
727
555
  componentWillUnmount() {
728
- this.unmount = !0, this.offClickOutside(), this.clearTimer(), this.offWindowResize(), this.offScrollListeners(), this.offContainerResize(), G(this.rafId), this.resizeObserver2Disconnect(), this.resizeObserver3Disconnect();
556
+ this.unmount = !0, this.offClickOutside(), this.clearTimer(), this.offWindowResize(), this.offScrollListeners(), this.offContainerResize(), k(this.rafId), this.offResizeObserver2(), this.offResizeObserver3();
729
557
  }
730
558
  clearDelayTimer() {
731
559
  this.delayTimer && (clearTimeout(this.delayTimer), this.delayTimer = null);
732
560
  }
733
561
  render() {
734
- var $;
562
+ var z;
735
563
  const {
736
- children: t,
737
- style: e,
738
- className: i,
739
- arrowProps: r,
740
- disabled: n,
741
- popup: u,
742
- classNames: P,
743
- duration: o,
744
- unmountOnExit: M,
745
- alignPoint: g,
746
- autoAlignPopupWidth: a,
747
- position: c,
748
- childrenPrefix: f,
749
- showArrow: m,
750
- popupStyle: V,
751
- __onExit: H,
752
- __onExited: N
753
- } = this.getMergedProps(), k = t || t === 0, { getPrefixCls: F, zIndex: p, rtl: v } = this.context, { popupVisible: y, popupStyle: O } = this.state;
754
- if (!u)
564
+ children: e,
565
+ style: t,
566
+ className: s,
567
+ arrowProps: o,
568
+ disabled: r,
569
+ popup: n,
570
+ classNames: a,
571
+ duration: T,
572
+ unmountOnExit: f,
573
+ alignPoint: v,
574
+ autoAlignPopupWidth: A,
575
+ position: I,
576
+ childrenPrefix: c,
577
+ showArrow: U,
578
+ popupStyle: _,
579
+ __onExit: M,
580
+ __onExited: E
581
+ } = this.getMergedProps(), S = e || e === 0, { getPrefixCls: Y, zIndex: q, rtl: Q } = this.context, { popupVisible: D, popupStyle: X } = this.state;
582
+ if (!n)
755
583
  return null;
756
- const d = {}, x = {
584
+ const p = {}, O = {
757
585
  onMouseDown: this.onPopupMouseDown
758
586
  };
759
- this.isHoverTrigger() && !n ? (d.onMouseEnter = this.onMouseEnter, d.onMouseLeave = this.onMouseLeave, this.isClickToHide() && (d.onClick = this.clickToHidePopup), g && (d.onMouseMove = this.onMouseMove), this.isPopupHoverHide() || (x.onMouseEnter = this.onPopupMouseEnter, x.onMouseLeave = this.onPopupMouseLeave)) : (d.onMouseEnter = this.triggerOriginEvent("onMouseEnter"), d.onMouseLeave = this.triggerOriginEvent("onMouseLeave")), this.isContextMenuTrigger() && !n ? (d.onContextMenu = this.onContextMenu, d.onClick = this.clickToHidePopup) : d.onContextMenu = this.triggerOriginEvent("onContextMenu"), this.isClickTrigger() && !n ? d.onClick = this.onClick : d.onClick = d.onClick || this.triggerOriginEvent("onClick"), this.isFocusTrigger() && !n ? (d.onFocus = this.onFocus, this.isBlurToHide() && (d.onBlur = this.onBlur)) : (d.onFocus = this.triggerOriginEvent("onFocus"), d.onBlur = this.triggerOriginEvent("onBlur")), n ? d.onKeyDown = this.triggerOriginEvent("onKeyDown") : d.onKeyDown = this.onKeyDown;
760
- const C = this.getChild(), w = A.Children.only(u());
761
- C.props.className && (d.className = C.props.className), f && y && (d.className = d.className ? `${d.className} ${f}-open` : `${f}-open`), this.isFocusTrigger() && (d.tabIndex = n ? -1 : 0);
762
- const D = F("trigger"), S = _(
763
- D,
764
- f,
765
- `${D}-position-${c}`,
766
- { [`${D}-rtl`]: v },
767
- i
768
- ), z = k && A.cloneElement(C, {
769
- ...d
770
- }), L = /* @__PURE__ */ R(
771
- st,
587
+ this.isHoverTrigger() && !r ? (p.onMouseEnter = this.onMouseEnter, p.onMouseLeave = this.onMouseLeave, this.isClickToHide() && (p.onClick = this.clickToHidePopup), v && (p.onMouseMove = this.onMouseMove), this.isPopupHoverHide() || (O.onMouseEnter = this.onPopupMouseEnter, O.onMouseLeave = this.onPopupMouseLeave)) : (p.onMouseEnter = this.triggerOriginEvent("onMouseEnter"), p.onMouseLeave = this.triggerOriginEvent("onMouseLeave")), this.isContextMenuTrigger() && !r ? (p.onContextMenu = this.onContextMenu, p.onClick = this.clickToHidePopup) : p.onContextMenu = this.triggerOriginEvent("onContextMenu"), this.isClickTrigger() && !r ? p.onClick = this.onClick : p.onClick = p.onClick || this.triggerOriginEvent("onClick"), this.isFocusTrigger() && !r ? (p.onFocus = this.onFocus, this.isBlurToHide() && (p.onBlur = this.onBlur)) : (p.onFocus = this.triggerOriginEvent("onFocus"), p.onBlur = this.triggerOriginEvent("onBlur")), r ? p.onKeyDown = this.triggerOriginEvent("onKeyDown") : p.onKeyDown = this.onKeyDown;
588
+ const m = this.getChild(), y = C.Children.only(n());
589
+ m.props.className && (p.className = m.props.className), c && D && (p.className = p.className ? `${p.className} ${c}-open` : `${c}-open`), this.isFocusTrigger() && (p.tabIndex = r ? -1 : 0);
590
+ const P = Y("trigger"), K = b(
591
+ P,
592
+ c,
593
+ `${P}-position-${I}`,
594
+ { [`${P}-rtl`]: Q },
595
+ s
596
+ ), G = S && C.cloneElement(m, {
597
+ ...p,
598
+ ref: ne(m) ? (l) => {
599
+ this.rootElementRef = l, ae(m, l);
600
+ } : void 0
601
+ }), j = /* @__PURE__ */ d(
602
+ ee,
772
603
  {
773
- in: !!y,
774
- timeout: o,
775
- classNames: P,
776
- unmountOnExit: M,
604
+ in: !!D,
605
+ timeout: T,
606
+ classNames: a,
607
+ unmountOnExit: f,
777
608
  appear: !0,
778
609
  mountOnEnter: !0,
779
- onEnter: (T) => {
780
- T.style.display = "initial", T.style.pointerEvents = "none", P === "slideDynamicOrigin" && (T.style.transform = this.getTransformTranslate());
610
+ onEnter: () => {
611
+ this.triggerRefDestoried = !1;
612
+ const l = this.getPopupElement();
613
+ l && (l.style.display = "initial", l.style.pointerEvents = "none", a === "slideDynamicOrigin" && (l.style.transform = this.getTransformTranslate()));
781
614
  },
782
- onEntering: (T) => {
783
- P === "slideDynamicOrigin" && (T.style.transform = "");
615
+ onEntering: () => {
616
+ const l = this.getPopupElement();
617
+ l && a === "slideDynamicOrigin" && (l.style.transform = "");
784
618
  },
785
- onEntered: (T) => {
786
- T.style.pointerEvents = "auto", this.forceUpdate();
619
+ onEntered: () => {
620
+ const l = this.getPopupElement();
621
+ l && (l.style.pointerEvents = "auto", this.forceUpdate());
787
622
  },
788
- onExit: (T) => {
789
- T.style.pointerEvents = "none", H == null || H(T);
623
+ onExit: () => {
624
+ const l = this.getPopupElement();
625
+ l && (l.style.pointerEvents = "none", M == null || M(l));
790
626
  },
791
- onExited: (T) => {
792
- T.style.display = "none", M && (this.refTrigger = null), this.setState({ popupStyle: {} }), N == null || N(T);
627
+ onExited: () => {
628
+ const l = this.getPopupElement();
629
+ l && (l.style.display = "none", f && (this.triggerRefDestoried = !0), this.setState({ popupStyle: {} }), E == null || E(l));
793
630
  },
794
- children: /* @__PURE__ */ X(
631
+ nodeRef: this.triggerRef,
632
+ children: /* @__PURE__ */ V(
795
633
  "span",
796
634
  {
797
- ref: (T) => {
798
- this.resizeObserver2Disconnect(), this.refTrigger = T, this.resizeObserver2Observe();
799
- },
635
+ ref: this.triggerRef,
800
636
  "trigger-placement": this.realPosition,
801
637
  style: {
802
- width: a && (e == null ? void 0 : e.width) === void 0 ? ($ = this.childrenDomSize) == null ? void 0 : $.width : "",
803
- ...O,
638
+ width: A && (t == null ? void 0 : t.width) === void 0 ? (z = this.childrenDomSize) == null ? void 0 : z.width : "",
639
+ ...X,
804
640
  position: "absolute",
805
- zIndex: p || "",
806
- ...e
641
+ zIndex: q || "",
642
+ ...t
807
643
  // display
808
644
  },
809
- ...x,
810
- className: S,
811
- ...mt(this.props),
645
+ ...O,
646
+ className: K,
647
+ ...le(this.props),
812
648
  children: [
813
- /* @__PURE__ */ R(
814
- w.type,
649
+ /* @__PURE__ */ d(
650
+ y.type,
815
651
  {
816
- ref: w.ref,
817
- ...w.props,
818
- style: { ...w.props.style, ...V }
652
+ ref: y.ref,
653
+ ...y.props,
654
+ style: { ...y.props.style, ..._ }
819
655
  }
820
656
  ),
821
- (m || r) && /* @__PURE__ */ R(
657
+ (U || o) && /* @__PURE__ */ d(
822
658
  "div",
823
659
  {
824
- className: _(`${D}-arrow-container`, {
825
- [`${f}-arrow-container`]: f
660
+ className: b(`${P}-arrow-container`, {
661
+ [`${c}-arrow-container`]: c
826
662
  }),
827
- children: /* @__PURE__ */ R(
663
+ children: /* @__PURE__ */ d(
828
664
  "div",
829
665
  {
830
- ...r,
831
- className: _(
832
- `${D}-arrow`,
666
+ ...o,
667
+ className: b(
668
+ `${P}-arrow`,
833
669
  {
834
- [`${f}-arrow`]: f
670
+ [`${c}-arrow`]: c
835
671
  },
836
- r == null ? void 0 : r.className
672
+ o == null ? void 0 : o.className
837
673
  ),
838
- style: { ...this.arrowStyle, ...r == null ? void 0 : r.style }
674
+ style: { ...this.arrowStyle, ...o == null ? void 0 : o.style }
839
675
  }
840
676
  )
841
677
  }
@@ -844,15 +680,15 @@ class Z extends ht {
844
680
  }
845
681
  )
846
682
  }
847
- ), b = y || this.refTrigger ? /* @__PURE__ */ R(yt, { getContainer: this.getContainer, children: L }) : null;
848
- return k ? /* @__PURE__ */ X(A.Fragment, { children: [
849
- z,
850
- b
851
- ] }) : b;
683
+ ), x = D || this.getPopupElement() && !this.triggerRefDestoried ? /* @__PURE__ */ d(ce, { getContainer: this.getContainer, children: j }) : null;
684
+ return S ? /* @__PURE__ */ V(C.Fragment, { children: [
685
+ G,
686
+ x
687
+ ] }) : x;
852
688
  }
853
689
  }
854
- s(Z, "displayName", "Trigger"), s(Z, "contextType", ct);
690
+ i(W, "displayName", "Trigger"), i(W, "contextType", fe);
855
691
  export {
856
- Kt as EventsByTriggerNeed,
857
- Z as default
692
+ We as EventsByTriggerNeed,
693
+ W as default
858
694
  };