@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/Slider.js CHANGED
@@ -1,667 +1,193 @@
1
- import { jsx as I, jsxs as gt } from "react/jsx-runtime";
2
- import { a as Dt } from "./chunk/BSs6uXmc.js";
3
- import "./chunk/C6Kfwj0f.js";
4
- import "./chunk/RnTpOC5-.js";
5
- import "./chunk/DP2rzg_V.js";
6
- import se from "./Trigger.js";
7
- import "./Tooltip.js";
8
- import { minus as pt, times as wt, plus as ot, divide as Rt } from "@unicom-cloud/utils/math";
9
- import ht from "lodash/isArray";
10
- import L from "lodash/isFunction";
11
- import rt from "lodash/isPlainObject";
12
- import _, { useState as St, useContext as Et, useMemo as Z, useRef as S, useEffect as Lt, createElement as Tt, useCallback as H, forwardRef as ae } from "react";
13
- import { a as Bt } from "./chunk/Dr0iXIXO.js";
14
- import ue from "./hooks/useMergeProps.js";
15
- import Ft from "./hooks/useMergeValue.js";
16
- import le from "./hooks/useUpdateEffect.js";
17
- import Y from "@unicom-cloud/utils/class-name";
18
- import { on as U, off as W } from "./utils/dom.js";
19
- import ce from "./utils/omit.js";
20
- import nt from "lodash/isNumber";
21
- import fe from "lodash/isString";
22
- import me from "./hooks/useKeyboardEvent.js";
23
- import { isEmptyObject as de } from "@unicom-cloud/utils/is";
24
- import ge from "lodash/isUndefined";
25
- const pe = { maxWidth: 350 }, he = {
26
- enter: 300,
27
- exit: 100
28
- }, ve = {
29
- left: 12,
30
- right: 12,
31
- top: 12,
32
- bottom: 12
33
- }, we = function(t) {
34
- const {
35
- style: o,
36
- disabled: n,
37
- prefixCls: r,
38
- value: s,
39
- vertical: d,
40
- tooltipVisible: k,
41
- tooltipPosition: m,
42
- formatTooltip: b,
43
- getTooltipContainer: c,
44
- onMoving: V,
45
- onMoveEnd: h,
46
- onMoveBegin: f
47
- } = t, e = me(), [g, w] = St(!1), [v, i] = Ft(!1, {
48
- value: k
49
- }), { getPrefixCls: u } = Et(Bt), M = Z(
50
- () => m || (d ? "right" : "top"),
51
- [m, d]
52
- ), T = S(null), K = S(!1), z = S(!1), P = S(null);
53
- function at(C) {
54
- C.stopPropagation(), !n && (it(C), w(!0), U(window, "mousemove", E), U(window, "touchmove", E), U(window, "mouseup", R), U(window, "touchend", R), U(window, "contextmenu", R));
55
- }
56
- function O() {
57
- K.current = !0, J(), v || (T.current = setTimeout(() => {
58
- j(!0);
59
- }, 50));
60
- }
61
- function D() {
62
- K.current = !1, z.current || (J(), T.current = setTimeout(() => {
63
- j(!1);
64
- }, 200));
65
- }
66
- function it(C) {
67
- var B;
68
- C.preventDefault();
69
- const N = document.activeElement;
70
- (B = N == null ? void 0 : N.blur) == null || B.call(N), L(f) && f();
71
- }
72
- function E(C) {
73
- z.current = !0, C.type === "touchstart" && (C.clientY = C.touches[0].clientY, C.clientX = C.touches[0].clientX), L(V) && V(C.clientX, C.clientY);
74
- }
75
- function R() {
76
- z.current = !1, w(!1), ut(), j(K.current), L(h) && h();
77
- }
78
- function ut() {
79
- J(), W(window, "mousemove", E), W(window, "touchmove", E), W(window, "mouseup", R), W(window, "touchend", R), W(window, "contextmenu", R);
80
- }
81
- function J() {
82
- T.current && (clearTimeout(T.current), T.current = null);
83
- }
84
- function j(C) {
85
- if (z.current)
86
- return;
87
- const N = "tooltipVisible" in t ? k : C;
88
- i(N);
89
- }
90
- function lt() {
91
- K.current = !0, J();
92
- }
93
- const x = Z(() => L(b) ? b(s) : s, [b, s]);
94
- function tt(C) {
95
- const N = u("tooltip");
96
- return /* @__PURE__ */ I(
97
- "div",
98
- {
99
- className: Y(
100
- `${N}-content`,
101
- `${N}-content-${C}`
102
- ),
103
- onMouseLeave: D,
104
- onMouseEnter: lt,
105
- onClick: (B) => {
106
- B.stopPropagation();
107
- },
108
- children: /* @__PURE__ */ I("div", { className: `${N}-content-inner`, children: x })
109
- }
110
- );
111
- }
112
- return Lt(() => {
113
- P && P.current && P.current.updatePopupPosition();
114
- }, [s]), /* @__PURE__ */ I(
115
- se,
116
- {
117
- style: pe,
118
- classNames: "zoomInFadeOut",
119
- duration: he,
120
- showArrow: !0,
121
- popupAlign: ve,
122
- ref: P,
123
- popup: () => tt(M),
124
- popupVisible: v,
125
- disabled: k === !1,
126
- getPopupContainer: c,
127
- position: M,
128
- childrenPrefix: u("tooltip"),
129
- children: /* @__PURE__ */ I(
130
- "div",
131
- {
132
- className: Y(`${r}-button`, {
133
- [`${r}-button-active`]: g
134
- }),
135
- onMouseDown: at,
136
- onMouseEnter: O,
137
- onMouseLeave: D,
138
- style: o,
139
- role: "slider",
140
- "aria-valuemax": t.maxValue,
141
- "aria-valuemin": t.minValue,
142
- "aria-valuenow": s,
143
- "aria-disabled": !!n,
144
- tabIndex: n ? -1 : 0,
145
- "aria-valuetext": fe(x) || nt(x) ? String(x) : void 0,
146
- ...e({
147
- onArrowRight: (C) => {
148
- var N;
149
- C.preventDefault(), (N = t.onArrowEvent) == null || N.call(t, "addition");
150
- },
151
- onArrowUp: (C) => {
152
- var N;
153
- C.preventDefault(), (N = t.onArrowEvent) == null || N.call(t, "addition");
154
- },
155
- onArrowLeft: (C) => {
156
- var N;
157
- C.preventDefault(), (N = t.onArrowEvent) == null || N.call(t, "subtraction");
158
- },
159
- onArrowDown: (C) => {
160
- var N;
161
- C.preventDefault(), (N = t.onArrowEvent) == null || N.call(t, "subtraction");
162
- }
163
- })
164
- }
165
- )
166
- }
167
- );
168
- }, be = _.memo(we);
169
- function Ve(t) {
170
- const o = `${t}`.split(".")[1];
171
- return o && o.length || 0;
172
- }
173
- function X(t) {
174
- return `${t * 100}%`;
175
- }
176
- function Me(t, o) {
177
- const n = Number(t);
178
- if (o && !isNaN(n)) {
179
- const [r, s] = o;
180
- return Rt(pt(n, r), pt(s, r));
181
- }
182
- return 0;
183
- }
184
- function jt(t, o) {
185
- const n = Number(t);
186
- return o.sort((r, s) => r - s), n >= o[0] && n <= o[1];
187
- }
188
- function dt(t) {
189
- return t || t === 0;
190
- }
191
- function Ce(t) {
192
- const o = parseFloat(t), n = o > 1 ? (o / 100).toFixed(2) : o, r = parseFloat(n);
193
- if (!isNaN(r) && r >= 0 && r <= 1)
194
- return r;
195
- }
196
- function Q(t, o) {
197
- const n = o.find(
198
- (r) => t >= r.begin && t <= r.end
199
- );
200
- if (n) {
201
- const { beginOffset: r, begin: s, end: d, endOffset: k } = n, m = Me(t, [s, d]), b = pt(k, r), c = wt(m, b);
202
- return ot(r, c);
203
- }
204
- }
205
- function vt(t) {
206
- const o = t.slice(0);
207
- return o.sort((n, r) => n - r), o;
208
- }
209
- function xe(t) {
210
- return t.some((o, n) => o > t[n + 1]);
211
- }
212
- function Ne(t, o) {
213
- let n = o.indexOf(t);
214
- return n === -1 ? (n = vt(o.concat(t)).indexOf(t), [
215
- Math.max(n - 1, 0),
216
- Math.min(n, o.length - 1)
217
- ]) : [n, n + 1];
218
- }
219
- const ke = function(t) {
220
- const {
221
- data: o = [],
222
- valueRange: n = [],
223
- vertical: r,
224
- prefixCls: s,
225
- reverse: d,
226
- intervalConfigs: k
227
- } = t;
228
- return o.length ? /* @__PURE__ */ I("div", { className: `${s}-dots`, children: o.map(({ key: m, content: b }) => {
229
- const c = X(Q(+m, k));
230
- return /* @__PURE__ */ I(
231
- "div",
232
- {
233
- className: `${s}-dot-wrapper`,
234
- style: {
235
- ...r ? { [d ? "top" : "bottom"]: c } : { [d ? "right" : "left"]: c }
236
- },
237
- onMouseDown: (V) => {
238
- V.stopPropagation(), L(t.onMouseDown) && t.onMouseDown(parseFloat(m));
239
- },
240
- children: rt(b) && b.dot ? b.dot : /* @__PURE__ */ I(
241
- "div",
242
- {
243
- className: Y(`${s}-dot`, {
244
- [`${s}-dot-active`]: jt(m, n)
245
- })
246
- }
247
- )
248
- },
249
- m
250
- );
251
- }) }) : null;
252
- }, Ie = _.memo(ke), ye = function(t) {
253
- const {
254
- value: o,
255
- range: n,
256
- min: r,
257
- max: s,
258
- step: d,
259
- disabled: k,
260
- prefixCls: m,
261
- onChange: b,
262
- extra: c = []
263
- } = t, V = {
264
- min: r,
265
- max: s,
266
- step: d,
267
- disabled: k
268
- }, [h, f] = St(o), e = c[0], g = n ? c[1] : c[0];
269
- Lt(() => {
270
- f(o);
271
- }, [o]);
272
- const w = (i) => {
273
- b == null || b(i);
274
- }, v = () => {
275
- f([...o].sort((i, u) => i - u));
276
- };
277
- return /* @__PURE__ */ gt(
278
- "div",
279
- {
280
- className: Y(`${m}-input`, {
281
- [`${m}-input-group`]: n
282
- }),
283
- onBlur: v,
284
- children: [
285
- n && [
286
- /* @__PURE__ */ Tt(
287
- Dt,
288
- {
289
- hideControl: !0,
290
- ...e,
291
- ...V,
292
- value: h[0],
293
- key: 0,
294
- onChange: (i, u) => {
295
- var M;
296
- isNaN(i) && i !== i || (w([i, h[1]]), (M = e == null ? void 0 : e.onChange) == null || M.call(e, i, u));
297
- }
298
- }
299
- ),
300
- /* @__PURE__ */ I("div", { className: `${m}-input-range`, children: /* @__PURE__ */ I("span", { className: `${m}-input-range-content` }) }, 1)
301
- ],
302
- /* @__PURE__ */ Tt(
303
- Dt,
304
- {
305
- hideControl: !0,
306
- ...g,
307
- ...V,
308
- key: 2,
309
- value: h[1],
310
- onChange: (i, u) => {
311
- var M;
312
- isNaN(i) && i !== i || (w([h[0], i]), (M = g == null ? void 0 : g.onChange) == null || M.call(g, i, u));
313
- }
314
- }
315
- )
316
- ]
317
- }
318
- );
319
- }, $e = _.memo(ye), Oe = function(t) {
320
- const { data: o = [], vertical: n, prefixCls: r, reverse: s, intervalConfigs: d } = t;
321
- return o.length ? /* @__PURE__ */ I("div", { className: `${r}-marks`, children: o.map(({ key: k, content: m }) => {
322
- const b = X(Q(+k, d));
323
- let c = null;
324
- return rt(m) && dt(m.text) ? c = m.text : dt(m) && (c = m), dt(c) && /* @__PURE__ */ I(
325
- "div",
326
- {
327
- className: `${r}-marks-text`,
328
- "aria-hidden": !0,
329
- style: n ? { [s ? "top" : "bottom"]: b } : { [s ? "right" : "left"]: b },
330
- onMouseDown: (V) => {
331
- V.stopPropagation(), L(t.onMouseDown) && t.onMouseDown(parseFloat(k));
332
- },
333
- children: c
334
- },
335
- k
336
- );
337
- }) }) : null;
338
- }, Pe = _.memo(Oe);
339
- function Ae(t) {
340
- const {
341
- min: o,
342
- max: n,
343
- valueRange: r,
344
- prefixCls: s,
345
- vertical: d,
346
- reverse: k,
347
- intervalConfigs: m
348
- } = t, b = /* @__PURE__ */ new Map(), c = (h) => {
349
- const { step: f, begin: e, end: g } = h, w = Math.floor((g - e) / f);
350
- for (let v = 0; v <= w; v++) {
351
- const i = ot(v * f, e);
352
- if (i <= o || i >= n)
353
- continue;
354
- const u = X(Q(i, m));
355
- b.set(u, {
356
- offset: u,
357
- isActive: jt(i, r)
358
- });
359
- }
360
- }, V = Z(() => {
361
- var h;
362
- return b.clear(), (h = m == null ? void 0 : m.forEach) == null || h.call(m, (f) => c(f)), Array.from(b.values());
363
- }, [m]);
364
- return /* @__PURE__ */ I("div", { className: `${s}-ticks`, children: V.map((h, f) => /* @__PURE__ */ I(
365
- "div",
366
- {
367
- className: Y(`${s}-tick`, {
368
- [`${s}-tick-active`]: h.isActive
369
- }),
370
- style: d ? { [k ? "top" : "bottom"]: h.offset } : { [k ? "right" : "left"]: h.offset }
371
- },
372
- f
373
- )) });
374
- }
375
- const De = _.memo(Ae);
376
- function Te(t) {
377
- if (t.length < 2)
378
- return [];
379
- const o = [];
380
- for (let n = 1; n < t.length; n++) {
381
- const r = t[n - 1], s = t[n];
382
- o.push([r, s]);
383
- }
384
- return o;
385
- }
386
- function Re(t) {
387
- const { marks: o = {}, getIntervalConfig: n, max: r, min: s } = t, { markIntervals: d, markList: k } = Z(() => {
388
- const b = Object.keys(o).filter((f) => nt(+f) && +f >= s && +f <= r).sort((f, e) => +f > +e ? 1 : -1), c = b.map((f) => ({ key: f, content: o[f] }));
389
- let V = b.map((f) => +f);
390
- return V.length === 0 ? V = [s, r] : (V[0] > s && (V.unshift(s), c.unshift({ key: `${s}`, content: "" })), V.slice(-1)[0] < r && (V.push(r), c.push({ key: `${r}`, content: "" }))), { markIntervals: Te(V), markList: c };
391
- }, [o, s, r]);
392
- return {
393
- intervalConfigs: Z(() => {
394
- if (!L(n))
395
- return [
396
- {
397
- begin: s,
398
- end: r,
399
- step: t.step,
400
- beginOffset: 0,
401
- endOffset: 1,
402
- width: 1
403
- }
404
- ];
405
- const b = ([e, g], w) => {
406
- const v = { step: t.step, width: 0 }, i = n([e, g], w) || {}, u = i.step, M = Ce(i.width);
407
- return nt(u) && u && (v.step = u), nt(M) && M && (v.width = M), v;
408
- };
409
- let c = 1, V = r - s;
410
- const h = d.map(([e, g], w) => {
411
- const v = b([e, g], w);
412
- let i = v.width;
413
- if (i) {
414
- i = Math.min(c, i);
415
- const u = g - e;
416
- V -= u, c -= i;
417
- }
418
- return { width: i, step: v.step };
419
- });
420
- if (h.every(({ width: e }) => e) && c) {
421
- const e = h[d.length - 1];
422
- e.width += c;
423
- }
424
- const f = [];
425
- return d.forEach(([e, g], w) => {
426
- const { step: v, width: i } = h[w], u = {
427
- begin: e,
428
- end: g,
429
- step: v,
430
- beginOffset: 0,
431
- endOffset: 0,
432
- width: i
433
- };
434
- u.width || (u.width = c * ((g - e) / V));
435
- const M = f.length - 1;
436
- f[M] && (u.beginOffset = f[M].endOffset), u.endOffset = Math.min(1, u.beginOffset + u.width), f.push(u);
437
- }), f;
438
- }, [n, d, r, s, t.step]),
439
- markList: k
440
- };
441
- }
442
- function Se(t) {
443
- const { isRange: o, min: n, max: r, onlyMarkValue: s, intervalConfigs: d, marks: k } = t, m = H(
444
- (e) => {
445
- const g = d.find((w) => e >= w.begin && e <= w.end);
446
- if (g) {
447
- const { begin: w, step: v } = g, i = e - w, u = Math.round(i / v), M = Ve(v), T = parseFloat(
448
- wt(v, u).toFixed(M)
449
- );
450
- return ot(w, T);
451
- }
452
- return e;
453
- },
454
- [d]
455
- ), b = H(
456
- (e) => {
457
- if (!rt(k) || de(k))
458
- return console.warn("marks must be an object when onlyMarkValue is true"), n;
459
- if (k[e])
460
- return e;
461
- const g = Object.keys(k), w = g.map((i) => Math.abs(e - parseFloat(i))), v = w.indexOf(Math.min.apply(null, w));
462
- return parseFloat(g[v]);
463
- },
464
- [k, n]
465
- ), c = H(
466
- (e) => ge(e) || e <= n ? n : e >= r ? r : s ? b(e) : m(e),
467
- [b, m, r, n, s]
468
- ), V = H(
469
- (e) => c(e) === e,
470
- [c]
471
- ), h = H(
472
- (e) => {
473
- let [g, w] = [n, n];
474
- if (o) {
475
- if (ht(e))
476
- return g = c(e[0]), e.map((v) => c(v));
477
- console.error("value must be an array when range is true");
478
- } else
479
- nt(e) ? w = c(e) : console.error("value must be a number when range is false");
480
- return [g, w];
481
- },
482
- [c, o, n]
483
- ), f = H(
484
- (e, g) => {
485
- const w = g === "subtraction" ? -1 : 1;
486
- let v = ot(e, w * t.step);
487
- if (t.onlyMarkValue) {
488
- const i = Object.keys(t.marks), u = i.findIndex((M) => Number(M) === e);
489
- v = i[u + w] !== void 0 ? Number(i[u + w]) : e;
490
- }
491
- return v;
492
- },
493
- [t.marks, t.onlyMarkValue, t.step]
494
- );
495
- return {
496
- getLegalRangeValue: h,
497
- getLegalValue: c,
498
- isLegalValue: V,
499
- getNextMarkValue: f
500
- };
501
- }
502
- const Ee = {
1
+ import { jsx as d, jsxs as oe } from "react/jsx-runtime";
2
+ /* empty css */
3
+ /* empty css */
4
+ /* empty css */
5
+ /* empty css */
6
+ /* empty css */
7
+ /* empty css */
8
+ /* empty css */
9
+ import { divide as Fe, plus as Je, times as qe } from "@unicom-cloud/utils/math";
10
+ import ne from "lodash/isArray";
11
+ import re from "lodash/isFunction";
12
+ import ie from "lodash/isPlainObject";
13
+ import ze, { forwardRef as Ge, useContext as He, useRef as V, useMemo as Ke } from "react";
14
+ import "./config-provider/ConfigProvider.js";
15
+ import Qe from "./hooks/useMergeProps.js";
16
+ import We from "./hooks/useMergeValue.js";
17
+ import Ze from "./hooks/useUpdateEffect.js";
18
+ import ae from "@unicom-cloud/utils/class-name";
19
+ import { on as se, off as le } from "./utils/dom.js";
20
+ import _e from "./utils/omit.js";
21
+ import et from "./slider/Button.js";
22
+ import tt from "./slider/Dot.js";
23
+ import ot from "./slider/Input.js";
24
+ import nt from "./slider/Mark.js";
25
+ import rt from "./slider/Tick.js";
26
+ import it from "./slider/hook/useInterval.js";
27
+ import at from "./slider/hook/useLegalValue.js";
28
+ import { needSort as st, sortNumberArray as ue, getIntervalOffset as j, formatPercent as y, findNearestIndex as lt } from "./slider/util.js";
29
+ import { ConfigContext as ut } from "./config-provider/context.js";
30
+ const ct = {
503
31
  max: 100,
504
32
  min: 0,
505
33
  step: 1
506
34
  };
507
- function Le(t, o) {
508
- const { getPrefixCls: n, componentConfig: r, rtl: s } = Et(Bt), d = ue(
509
- t,
510
- Ee,
511
- r == null ? void 0 : r.Slider
35
+ function ft(fe, me) {
36
+ const { getPrefixCls: pe, componentConfig: I, rtl: U } = He(ut), l = Qe(
37
+ fe,
38
+ ct,
39
+ I == null ? void 0 : I.Slider
512
40
  ), {
513
- className: k,
514
- style: m,
515
- tooltipVisible: b,
516
- tooltipPosition: c,
517
- disabled: V,
518
- min: h,
519
- max: f,
520
- range: e,
521
- step: g,
522
- showTicks: w,
523
- marks: v,
524
- onlyMarkValue: i,
41
+ className: ge,
42
+ style: de,
43
+ tooltipVisible: ve,
44
+ tooltipPosition: he,
45
+ disabled: C,
46
+ min: c,
47
+ max: w,
48
+ range: P,
49
+ step: R,
50
+ showTicks: Ve,
51
+ marks: N,
52
+ onlyMarkValue: k,
525
53
  vertical: u,
526
- showInput: M,
527
- reverse: T,
528
- getIntervalConfig: K,
529
- ...z
530
- } = d, P = !!e, at = rt(e) ? { ...e } : { draggableBar: !1 }, O = s ? !T : T, { intervalConfigs: D, markList: it } = Re({
531
- min: h,
532
- max: f,
533
- onlyMarkValue: i,
534
- step: g,
535
- marks: v,
536
- getIntervalConfig: K
537
- }), { getLegalValue: E, getLegalRangeValue: R, isLegalValue: ut, getNextMarkValue: J } = Se({
538
- isRange: P,
539
- min: h,
540
- max: f,
541
- onlyMarkValue: i,
542
- step: g,
543
- intervalConfigs: D,
544
- marks: v
545
- }), [j, lt] = Ft(
546
- P ? [h, h] : h,
54
+ showInput: f,
55
+ reverse: X,
56
+ getIntervalConfig: Ce,
57
+ ...we
58
+ } = l, m = !!P, Me = ie(P) ? { ...P } : { draggableBar: !1 }, s = U ? !X : X, { intervalConfigs: p, markList: Y } = it({
59
+ min: c,
60
+ max: w,
61
+ onlyMarkValue: k,
62
+ step: R,
63
+ marks: N,
64
+ getIntervalConfig: Ce
65
+ }), { getLegalValue: b, getLegalRangeValue: B, isLegalValue: be, getNextMarkValue: xe } = at({
66
+ isRange: m,
67
+ min: c,
68
+ max: w,
69
+ onlyMarkValue: k,
70
+ step: R,
71
+ intervalConfigs: p,
72
+ marks: N
73
+ }), [O, ye] = We(
74
+ m ? [c, c] : c,
547
75
  {
548
- defaultValue: d.defaultValue,
549
- value: d.value
76
+ defaultValue: l.defaultValue,
77
+ value: l.value
550
78
  }
551
79
  );
552
- let x = R(j);
553
- const tt = S(x), C = S(xe(x));
554
- le(() => {
555
- tt.current = R(j);
556
- }, [j, R]), C.current && (x = vt(x));
557
- const N = x[x.length - 1], B = x[0], ct = M && !i && (!P || x.length < 3), Wt = Z(() => ct && (ht(M) || rt(M)) ? ht(M) ? [...M] : [{ ...M }, { ...M }] : [], [ct, M]), $ = n("slider"), bt = S(null), Vt = S({
80
+ let n = B(O);
81
+ const S = V(n), T = V(st(n));
82
+ Ze(() => {
83
+ S.current = B(O);
84
+ }, [O, B]), T.current && (n = ue(n));
85
+ const $ = n[n.length - 1], A = n[0], D = f && !k && (!m || n.length < 3), Ie = Ke(() => D && (ne(f) || ie(f)) ? ne(f) ? [...f] : [{ ...f }, { ...f }] : [], [D, f]), i = pe("slider"), F = V(null), J = V({
558
86
  left: 0,
559
87
  height: 0,
560
88
  top: 0,
561
89
  width: 0
562
- }), Mt = S(!1), Ct = S(0);
563
- function xt(l) {
564
- const a = vt(l);
565
- return P ? a : a[a.length - 1];
566
- }
567
- function Xt(l) {
568
- const a = l.map((p) => E(p));
569
- return tt.current = a, a;
570
- }
571
- function q(l, a) {
572
- const p = Xt(l), y = xt(p);
573
- lt(y), a === "inputValueChange" ? C.current = p.some((A, G) => A > p[G]) : C.current = !1, L(d.onChange) && d.onChange(y);
574
- }
575
- function st() {
576
- if (L(d.onAfterChange)) {
577
- const l = xt(tt.current);
578
- d.onAfterChange(l);
90
+ }), q = V(!1), z = V(0);
91
+ function G(t) {
92
+ const e = ue(t);
93
+ return m ? e : e[e.length - 1];
94
+ }
95
+ function Pe(t) {
96
+ const e = t.map((o) => b(o));
97
+ return S.current = e, e;
98
+ }
99
+ function v(t, e) {
100
+ const o = Pe(t), r = G(o);
101
+ ye(r), e === "inputValueChange" ? T.current = o.some((a, h) => a > o[h]) : T.current = !1, re(l.onChange) && l.onChange(r);
102
+ }
103
+ function x() {
104
+ if (re(l.onAfterChange)) {
105
+ const t = G(S.current);
106
+ l.onAfterChange(t);
579
107
  }
580
108
  }
581
- function Yt(l) {
582
- let [a, p] = [x[0], x[x.length - 1]];
583
- return a > p && ([a, p] = [p, a]), P ? l >= a && l <= p : l <= p;
109
+ function Re(t) {
110
+ let [e, o] = [n[0], n[n.length - 1]];
111
+ return e > o && ([e, o] = [o, e]), m ? t >= e && t <= o : t <= o;
584
112
  }
585
- function ft(l, a) {
586
- const { left: p, top: y, width: A, height: G } = Vt.current;
587
- let F = A, yt = O ? p + A - l : l - p;
588
- if (u && (F = G, yt = O ? a - y : y + G - a), F <= 0)
113
+ function E(t, e) {
114
+ const { left: o, top: r, width: a, height: h } = J.current;
115
+ let g = a, W = s ? o + a - t : t - o;
116
+ if (u && (g = h, W = s ? e - r : r + h - e), g <= 0)
589
117
  return 0;
590
- let et = Math.max(Rt(yt, F), 0);
591
- et = Math.min(1, et);
592
- const _t = D.find((At) => et >= At.beginOffset && et <= At.endOffset), {
593
- begin: $t,
594
- beginOffset: Ot,
595
- step: Pt,
596
- endOffset: te,
597
- end: ee
598
- } = _t, ne = et - Ot, oe = te - Ot, re = ne / oe * (ee - $t), ie = Math.round(re / Pt);
599
- return ot($t, wt(ie, Pt));
600
- }
601
- function Kt(l) {
602
- let [a, p] = l;
603
- a > p && ([a, p] = [p, a]);
604
- const y = X(a), A = X(1 - p);
118
+ let M = Math.max(Fe(W, g), 0);
119
+ M = Math.min(1, M);
120
+ const De = p.find((te) => M >= te.beginOffset && M <= te.endOffset), {
121
+ begin: Z,
122
+ beginOffset: _,
123
+ step: ee,
124
+ endOffset: Ee,
125
+ end: Le
126
+ } = De, je = M - _, Ue = Ee - _, Xe = je / Ue * (Le - Z), Ye = Math.round(Xe / ee);
127
+ return Je(Z, qe(Ye, ee));
128
+ }
129
+ function Ne(t) {
130
+ let [e, o] = t;
131
+ e > o && ([e, o] = [o, e]);
132
+ const r = y(e), a = y(1 - o);
605
133
  return u ? {
606
- [O ? "top" : "bottom"]: y,
607
- [O ? "bottom" : "top"]: A
134
+ [s ? "top" : "bottom"]: r,
135
+ [s ? "bottom" : "top"]: a
608
136
  } : {
609
- [O ? "right" : "left"]: y,
610
- [O ? "left" : "right"]: A
137
+ [s ? "right" : "left"]: r,
138
+ [s ? "left" : "right"]: a
611
139
  };
612
140
  }
613
- function zt(l) {
614
- return u ? { [O ? "top" : "bottom"]: X(l) } : { [O ? "right" : "left"]: X(l) };
141
+ function ke(t) {
142
+ return u ? { [s ? "top" : "bottom"]: y(t) } : { [s ? "right" : "left"]: y(t) };
615
143
  }
616
- function Jt() {
617
- const l = {
618
- getTooltipContainer: d.getTooltipContainer,
619
- formatTooltip: d.formatTooltip
144
+ function Be() {
145
+ const t = {
146
+ getTooltipContainer: l.getTooltipContainer,
147
+ formatTooltip: l.formatTooltip
620
148
  };
621
- return "tooltipPosition" in d && (l.tooltipPosition = c), "tooltipVisible" in d && (l.tooltipVisible = b), l;
149
+ return "tooltipPosition" in l && (t.tooltipPosition = he), "tooltipVisible" in l && (t.tooltipVisible = ve), t;
622
150
  }
623
- function Nt() {
624
- Vt.current = bt.current.getBoundingClientRect();
151
+ function H() {
152
+ J.current = F.current.getBoundingClientRect();
625
153
  }
626
- function qt(l) {
627
- Nt();
628
- const a = ft(l.clientX, l.clientY);
629
- at.draggableBar && Yt(a) ? (Ct.current = E(a), U(window, "mousemove", kt), U(window, "mouseup", It)) : mt(a);
154
+ function Oe(t) {
155
+ H();
156
+ const e = E(t.clientX, t.clientY);
157
+ Me.draggableBar && Re(e) ? (z.current = b(e), se(window, "mousemove", K), se(window, "mouseup", Q)) : L(e);
630
158
  }
631
- function mt(l) {
632
- if (V)
633
- return;
634
- const a = E(l), [p, y] = Ne(a, x), A = x[p], G = x[y], F = x.slice(0);
635
- P && G - a > a - A ? (F[p] = a, q(F, "jumpToClick")) : (F[y] = a, q(F, "jumpToClick")), st();
159
+ function L(t) {
160
+ if (C) return;
161
+ const e = b(t), [o, r] = lt(e, n), a = n[o], h = n[r], g = n.slice(0);
162
+ m && h - e > e - a ? (g[o] = e, v(g, "jumpToClick")) : (g[r] = e, v(g, "jumpToClick")), x();
636
163
  }
637
- function Gt(l) {
638
- q(l, "inputValueChange"), st();
164
+ function Se(t) {
165
+ v(t, "inputValueChange"), x();
639
166
  }
640
- function Ht(l, a, p) {
641
- Mt.current = !0;
642
- const y = x.slice(0);
643
- y[p] = ft(l, a), q(y, "mousemove");
167
+ function Te(t, e, o) {
168
+ q.current = !0;
169
+ const r = n.slice(0);
170
+ r[o] = E(t, e), v(r, "mousemove");
644
171
  }
645
- function Qt() {
646
- Mt.current = !1, st();
172
+ function $e() {
173
+ q.current = !1, x();
647
174
  }
648
- function Zt(l, a) {
649
- if (V)
650
- return;
651
- const p = x.slice(0);
652
- p[a] = J(x[a], l), q(p);
175
+ function Ae(t, e) {
176
+ if (C) return;
177
+ const o = n.slice(0);
178
+ o[e] = xe(n[e], t), v(o);
653
179
  }
654
- function kt(l) {
655
- const p = E(ft(l.clientX, l.clientY)) - Ct.current, y = x.map((A) => A + p);
656
- y.every((A) => ut(A)) && q(y, "mousemove");
180
+ function K(t) {
181
+ const o = b(E(t.clientX, t.clientY)) - z.current, r = n.map((a) => a + o);
182
+ r.every((a) => be(a)) && v(r, "mousemove");
657
183
  }
658
- function It() {
659
- W(window, "mousemove", kt), W(window, "mouseup", It), st();
184
+ function Q() {
185
+ le(window, "mousemove", K), le(window, "mouseup", Q), x();
660
186
  }
661
- return /* @__PURE__ */ I(
187
+ return /* @__PURE__ */ d(
662
188
  "div",
663
189
  {
664
- ...ce(z, [
190
+ ..._e(we, [
665
191
  "defaultValue",
666
192
  "value",
667
193
  "onChange",
@@ -669,116 +195,116 @@ function Le(t, o) {
669
195
  "formatTooltip",
670
196
  "onAfterChange"
671
197
  ]),
672
- className: Y(
673
- $,
198
+ className: ae(
199
+ i,
674
200
  {
675
- [`${$}-vertical`]: u,
676
- [`${$}-with-marks`]: v,
677
- [`${$}-reverse`]: O,
678
- [`${$}-rtl`]: s
201
+ [`${i}-vertical`]: u,
202
+ [`${i}-with-marks`]: N,
203
+ [`${i}-reverse`]: s,
204
+ [`${i}-rtl`]: U
679
205
  },
680
- k
206
+ ge
681
207
  ),
682
- style: m,
683
- ref: o,
684
- children: /* @__PURE__ */ gt("div", { className: `${$}-wrapper`, children: [
685
- /* @__PURE__ */ gt(
208
+ style: de,
209
+ ref: me,
210
+ children: /* @__PURE__ */ oe("div", { className: `${i}-wrapper`, children: [
211
+ /* @__PURE__ */ oe(
686
212
  "div",
687
213
  {
688
- ref: bt,
689
- className: Y(`${$}-road`, {
690
- [`${$}-road-disabled`]: V,
691
- [`${$}-road-vertical`]: u
214
+ ref: F,
215
+ className: ae(`${i}-road`, {
216
+ [`${i}-road-disabled`]: C,
217
+ [`${i}-road-vertical`]: u
692
218
  }),
693
- onMouseDown: qt,
219
+ onMouseDown: Oe,
694
220
  children: [
695
- /* @__PURE__ */ I(
221
+ /* @__PURE__ */ d(
696
222
  "div",
697
223
  {
698
- className: `${$}-bar`,
699
- style: Kt([
700
- Q(B, D),
701
- Q(N, D)
224
+ className: `${i}-bar`,
225
+ style: Ne([
226
+ j(A, p),
227
+ j($, p)
702
228
  ])
703
229
  }
704
230
  ),
705
- w && /* @__PURE__ */ I(
706
- De,
231
+ Ve && /* @__PURE__ */ d(
232
+ rt,
707
233
  {
708
- intervalConfigs: D,
709
- min: h,
710
- max: f,
711
- valueRange: [B, N],
712
- prefixCls: $,
234
+ intervalConfigs: p,
235
+ min: c,
236
+ max: w,
237
+ valueRange: [A, $],
238
+ prefixCls: i,
713
239
  vertical: u,
714
- reverse: O
240
+ reverse: s
715
241
  }
716
242
  ),
717
- /* @__PURE__ */ I(
718
- Ie,
243
+ /* @__PURE__ */ d(
244
+ tt,
719
245
  {
720
- data: it,
721
- intervalConfigs: D,
722
- valueRange: [B, N],
246
+ data: Y,
247
+ intervalConfigs: p,
248
+ valueRange: [A, $],
723
249
  vertical: u,
724
- prefixCls: $,
725
- reverse: O,
726
- onMouseDown: mt
250
+ prefixCls: i,
251
+ reverse: s,
252
+ onMouseDown: L
727
253
  }
728
254
  ),
729
- /* @__PURE__ */ I(
730
- Pe,
255
+ /* @__PURE__ */ d(
256
+ nt,
731
257
  {
732
- data: it,
733
- intervalConfigs: D,
258
+ data: Y,
259
+ intervalConfigs: p,
734
260
  vertical: u,
735
- prefixCls: $,
736
- reverse: O,
737
- onMouseDown: mt
261
+ prefixCls: i,
262
+ reverse: s,
263
+ onMouseDown: L
738
264
  }
739
265
  ),
740
- x.map((l, a) => !P && a !== x.length - 1 ? null : /* @__PURE__ */ I(
741
- be,
266
+ n.map((t, e) => !m && e !== n.length - 1 ? null : /* @__PURE__ */ d(
267
+ et,
742
268
  {
743
- style: zt(Q(l, D)),
744
- disabled: V,
745
- prefixCls: $,
746
- value: l,
747
- maxValue: f,
748
- minValue: h,
269
+ style: ke(j(t, p)),
270
+ disabled: C,
271
+ prefixCls: i,
272
+ value: t,
273
+ maxValue: w,
274
+ minValue: c,
749
275
  vertical: u,
750
- ...Jt(),
751
- onMoveBegin: Nt,
752
- onMoving: (p, y) => Ht(p, y, a),
753
- onMoveEnd: Qt,
754
- onArrowEvent: (p) => Zt(p, a)
276
+ ...Be(),
277
+ onMoveBegin: H,
278
+ onMoving: (o, r) => Te(o, r, e),
279
+ onMoveEnd: $e,
280
+ onArrowEvent: (o) => Ae(o, e)
755
281
  },
756
- a
282
+ e
757
283
  ))
758
284
  ]
759
285
  }
760
286
  ),
761
- ct && /* @__PURE__ */ I(
762
- $e,
287
+ D && /* @__PURE__ */ d(
288
+ ot,
763
289
  {
764
- min: h,
765
- max: f,
766
- step: g,
767
- value: x,
768
- range: P,
769
- disabled: V,
770
- prefixCls: $,
771
- onChange: Gt,
772
- extra: Wt
290
+ min: c,
291
+ max: w,
292
+ step: R,
293
+ value: n,
294
+ range: m,
295
+ disabled: C,
296
+ prefixCls: i,
297
+ onChange: Se,
298
+ extra: Ie
773
299
  }
774
300
  )
775
301
  ] })
776
302
  }
777
303
  );
778
304
  }
779
- const Ut = ae(Le);
780
- Ut.displayName = "Slider";
781
- const ln = _.memo(Ut);
305
+ const ce = Ge(ft);
306
+ ce.displayName = "Slider";
307
+ const Xt = ze.memo(ce);
782
308
  export {
783
- ln as default
309
+ Xt as default
784
310
  };