@unicom-cloud/ui 0.8.90 → 0.8.91

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 (560) hide show
  1. package/Affix.js +10 -9
  2. package/Alert.js +6 -5
  3. package/AutoComplete.js +11 -8
  4. package/BackTop.js +12 -10
  5. package/Badge.js +10 -9
  6. package/Breadcrumb.js +10 -9
  7. package/Button.js +9 -8
  8. package/Calendar.js +13 -10
  9. package/Card.js +9 -8
  10. package/Carousel.js +9 -8
  11. package/Cascader.js +2 -2
  12. package/Checkbox.js +8 -6
  13. package/Collapse.js +3 -2
  14. package/ColorPicker.js +16 -13
  15. package/Comment.js +6 -5
  16. package/ConfigProvider.js +6 -5
  17. package/Copy.js +6 -5
  18. package/DatePicker.js +13 -8
  19. package/Descriptions.js +5 -4
  20. package/Details.js +15 -0
  21. package/Development.js +5 -3
  22. package/Divider.js +5 -4
  23. package/Draggable.js +4 -3
  24. package/Dropdown.js +12 -10
  25. package/Empty.js +6 -3
  26. package/Form.js +17 -13
  27. package/Icon.js +7 -6
  28. package/IconHover.js +4 -2
  29. package/Image.js +5 -5
  30. package/Input.js +17 -12
  31. package/InputNumber.js +7 -5
  32. package/Layout.js +13 -12
  33. package/Link.js +6 -5
  34. package/List.js +9 -7
  35. package/Loading.js +3 -2
  36. package/Mentions.js +7 -5
  37. package/Menu.js +7 -6
  38. package/Message.js +13 -6
  39. package/Modal.js +2 -2
  40. package/Notice.js +10 -7
  41. package/Notification.js +13 -7
  42. package/OverflowEllipsis.js +5 -4
  43. package/PageHeader.js +9 -7
  44. package/Pagination.js +2 -2
  45. package/Popconfirm.js +6 -5
  46. package/Popover.js +6 -5
  47. package/Progress.js +6 -5
  48. package/Radio.js +8 -6
  49. package/Rate.js +6 -5
  50. package/ResizeBox.js +12 -11
  51. package/Result.js +5 -4
  52. package/Select.js +6 -5
  53. package/SelectView.js +2 -2
  54. package/Skeleton.js +6 -5
  55. package/Slider.js +11 -8
  56. package/Space.js +6 -5
  57. package/SpeechSynthesis.js +4 -2
  58. package/Spin.js +6 -5
  59. package/Statistic.js +10 -8
  60. package/Steps.js +9 -8
  61. package/SuspenseFallbackTest.js +3 -2
  62. package/Switch.js +13 -8
  63. package/Table.js +27 -15
  64. package/Tabs.js +5 -5
  65. package/Tag.js +8 -6
  66. package/Tooltip.js +9 -7
  67. package/Transfer.js +8 -6
  68. package/Tree.js +3 -2
  69. package/TreeSelect.js +3 -3
  70. package/Trigger.js +17 -12
  71. package/Typography.js +7 -6
  72. package/Upload.js +6 -5
  73. package/affix/index.js +32 -31
  74. package/alert/index.js +60 -70
  75. package/anchor/Anchor.js +46 -45
  76. package/anchor/Link.js +9 -8
  77. package/anchor/util.js +15 -14
  78. package/auto-complete/index.js +154 -15
  79. package/avatar/Avatar.js +6 -5
  80. package/avatar/Group.js +17 -16
  81. package/back-top/index.js +38 -36
  82. package/badge/Count.js +11 -11
  83. package/badge/index.js +35 -34
  84. package/breadcrumb/Item.js +7 -7
  85. package/breadcrumb/index.js +29 -28
  86. package/button/Group.js +8 -7
  87. package/button/index.js +13 -12
  88. package/calendar/Month.js +140 -10
  89. package/calendar/Year.js +21 -20
  90. package/calendar/header/Panel.js +57 -0
  91. package/calendar/header/index.js +110 -0
  92. package/calendar/hook/useCellClassName.js +41 -0
  93. package/calendar/index.js +171 -14
  94. package/card/Grid.js +12 -11
  95. package/card/Meta.js +14 -13
  96. package/card/index.js +11 -10
  97. package/carousel/Arrow.js +16 -15
  98. package/carousel/Indicator.js +19 -18
  99. package/carousel/index.js +16 -15
  100. package/cascader/Cascader.js +299 -24
  101. package/cascader/base/node.js +142 -0
  102. package/cascader/base/store.js +93 -0
  103. package/cascader/hook/useRefCurrent.js +12 -0
  104. package/cascader/index.js +2 -2
  105. package/cascader/panel/List.js +278 -0
  106. package/cascader/panel/Option.js +33 -0
  107. package/cascader/panel/Search.js +169 -0
  108. package/cascader/util.js +64 -12
  109. package/checkbox/Checkbox.js +125 -17
  110. package/checkbox/Group.js +97 -12
  111. package/checkbox/GroupBlock.js +62 -6
  112. package/checkbox/index.js +7 -6
  113. package/collapse/Collapse.js +67 -234
  114. package/collapse/Item.js +181 -9
  115. package/collapse/index.js +1 -1
  116. package/color-picker/ControlBar.js +21 -20
  117. package/color-picker/InputAlpha.js +10 -9
  118. package/color-picker/InputHex.js +27 -25
  119. package/color-picker/InputRgb.js +27 -24
  120. package/color-picker/Palette.js +16 -14
  121. package/color-picker/Panel.js +269 -15
  122. package/color-picker/colors.js +8 -7
  123. package/color-picker/hooks/useColorPicker.js +128 -0
  124. package/{chunk/k-OUstoD.js → color-picker/hooks/useControlBlock.js} +1 -1
  125. package/color-picker/index.js +160 -24
  126. package/color-picker/utils.js +18 -17
  127. package/comment/index.js +23 -22
  128. package/components/common/development/index.js +32 -0
  129. package/components/common/empty/index.js +17 -0
  130. package/components/common/higher-order/with-speech-synthesis/index.js +61 -0
  131. package/{chunk/DxVvggX2.js → components/common/hooks/useComputedState.js} +2 -2
  132. package/components/common/hooks/useCreate.js +8 -0
  133. package/components/common/hooks/useForceUpdate.js +8 -0
  134. package/{chunk/B4YRLi8r.js → components/common/hooks/useId.js} +5 -5
  135. package/components/common/hooks/useInView.js +31 -0
  136. package/{chunk/B4WG1mhs.js → components/common/hooks/useIntersectionObserver.js} +9 -9
  137. package/components/common/hooks/useInterval.js +18 -0
  138. package/{chunk/oopARUrq.js → components/common/hooks/useIsFirstRender.js} +1 -1
  139. package/components/common/hooks/useIsomorphicLayoutEffect.js +6 -0
  140. package/components/common/hooks/useKeyboardEvent.js +17 -0
  141. package/{chunk/BL9DMeor.js → components/common/hooks/useListenResize.js} +1 -1
  142. package/{chunk/BXAeh0_V.js → components/common/hooks/useMedia.js} +1 -1
  143. package/{chunk/BFTV6myl.js → components/common/hooks/useMergeProps.js} +3 -3
  144. package/{chunk/D5wldVRB.js → components/common/hooks/useMergeValue.js} +8 -8
  145. package/{chunk/zmmqLCF4.js → components/common/hooks/useOnlineStatus.js} +1 -1
  146. package/{chunk/DU1RCDfh.js → components/common/hooks/useOverflowHidden.js} +1 -1
  147. package/components/common/hooks/useOverrideRef.js +14 -0
  148. package/{chunk/BsY85n3_.js → components/common/hooks/usePersistCallback.js} +2 -2
  149. package/{chunk/rT6qmv-Y.js → components/common/hooks/usePrefersColorSchemeDark.js} +5 -5
  150. package/components/common/hooks/usePrevious.js +10 -0
  151. package/components/common/hooks/useRefs.js +10 -0
  152. package/{chunk/CmZzBtA4.js → components/common/hooks/useResizeObserver.js} +4 -4
  153. package/{chunk/hEWZQ8Zi.js → components/common/hooks/useStateCallback.js} +5 -5
  154. package/{chunk/Duezix3m.js → components/common/hooks/useStateWithPromise.js} +6 -6
  155. package/components/common/hooks/useUpdateEffect.js +12 -0
  156. package/components/common/hooks/useWatch.js +11 -0
  157. package/{chunk/CB4jGw4K.js → components/common/hooks/useWindowSize.js} +6 -6
  158. package/components/common/icons/file/index.js +56 -0
  159. package/components/common/space/index.js +110 -0
  160. package/components/common/utils/PqbCSSTransition.js +32 -0
  161. package/{chunk/B6r8jPCd.js → components/common/utils/constant.js} +2 -2
  162. package/components/common/utils/copy.js +7 -0
  163. package/{chunk/B3LeSidy.js → components/common/utils/dayjs.js} +25 -24
  164. package/components/common/utils/dom.js +51 -0
  165. package/components/common/utils/fillNBSP.js +7 -0
  166. package/{chunk/B7M-FGia.js → components/common/utils/getHighlightText.js} +11 -10
  167. package/{chunk/Dh7Osrvr.js → components/common/utils/getHotkeyHandler.js} +6 -5
  168. package/{chunk/DKHXj8Kf.js → components/common/utils/getStringLength.js} +3 -2
  169. package/components/common/utils/include.js +10 -0
  170. package/components/common/utils/is.js +126 -0
  171. package/{chunk/DH7HTOV_.js → components/common/utils/mergeProps.js} +3 -2
  172. package/components/common/utils/mergedToString.js +16 -0
  173. package/components/common/utils/omit.js +12 -0
  174. package/components/common/utils/pad.js +18 -0
  175. package/components/common/utils/pick.js +18 -0
  176. package/components/common/utils/react19Adapter.js +3 -0
  177. package/{chunk/BZ3igxQN.js → components/common/utils/reactDOM.js} +13 -13
  178. package/components/common/utils/resizeObserverEffect.js +23 -0
  179. package/components/common/utils/scrollIntoView.js +25 -0
  180. package/components/common/utils/setDarkTheme.js +27 -0
  181. package/components/common/utils/setPrimaryColor.js +30 -0
  182. package/{chunk/DzekwbB4.js → components/common/utils/setTheme.js} +16 -14
  183. package/components/common/utils/style.js +39 -0
  184. package/components/common/utils/throttleByRaf.js +16 -0
  185. package/components/common/utils/warning.js +11 -0
  186. package/config-provider/ConfigProvider.js +56 -13
  187. package/config-provider/context.js +24 -7
  188. package/config-provider/index.js +6 -5
  189. package/copy/index.js +15 -14
  190. package/date-picker/Picker.js +75 -73
  191. package/date-picker/RangePicker.js +585 -22
  192. package/date-picker/hook/useCellClassName.js +60 -0
  193. package/date-picker/index.js +32 -27
  194. package/date-picker/panel/Body.js +88 -0
  195. package/date-picker/panel/Footer.js +71 -0
  196. package/date-picker/panel/Header.js +69 -0
  197. package/date-picker/panel/Shortcut.js +45 -0
  198. package/date-picker/panel/WeekList.js +19 -0
  199. package/date-picker/panel/date/index.js +193 -0
  200. package/date-picker/panel/month/index.js +112 -0
  201. package/date-picker/panel/quarter/index.js +97 -0
  202. package/date-picker/panel/range/index.js +250 -0
  203. package/date-picker/panel/week/index.js +35 -0
  204. package/date-picker/panel/year/index.js +73 -0
  205. package/date-picker/util.js +8 -8
  206. package/descriptions/index.js +24 -23
  207. package/details/index.js +82 -0
  208. package/details/interface.js +1 -0
  209. package/development/index.js +17 -36
  210. package/dist/compute-scroll-into-view/src/index.js +126 -0
  211. package/dist/dom-helpers/addClass.js +10 -0
  212. package/dist/dom-helpers/hasClass.js +8 -0
  213. package/dist/dom-helpers/removeClass.js +18 -0
  214. package/dist/react-transition-group/chunk/CPfP7aNL.js +381 -0
  215. package/dist/react-transition-group/chunk/F6QOOr2H.js +500 -0
  216. package/dist/react-transition-group/src/CSSTransition.js +202 -0
  217. package/dist/react-transition-group/src/ReplaceTransition.js +43 -0
  218. package/dist/react-transition-group/src/SwitchTransition.js +117 -0
  219. package/dist/react-transition-group/src/TransitionGroup.js +160 -0
  220. package/dist/react-transition-group/src/TransitionGroupContext.js +5 -0
  221. package/dist/react-transition-group/src/config.js +6 -0
  222. package/{chunk/Coz3rCng.js → dist/scroll-into-view-if-needed/src/index.js} +5 -5
  223. package/dist/tinycolor/chunk/DGZSWe7E.js +182 -0
  224. package/dist/tinycolor/customize/index.js +12 -0
  225. package/dist/tinycolor/src/conversion.js +143 -0
  226. package/dist/tinycolor/src/css-color-names.js +153 -0
  227. package/dist/tinycolor/src/format-input.js +77 -0
  228. package/dist/tinycolor/src/index.js +388 -0
  229. package/dist/tinycolor/src/util.js +32 -0
  230. package/dist/tween/src/easing.js +43 -0
  231. package/dist/tween/src/tween.js +70 -0
  232. package/dist/validate/chunk/BXTR2LmP.js +49 -0
  233. package/{chunk/DEuVgCzp.js → dist/validate/src/index.js} +91 -151
  234. package/dist/validate/src/util.js +22 -0
  235. package/divider/index.js +15 -14
  236. package/draggable/index.js +17 -16
  237. package/drawer/Drawer.js +41 -39
  238. package/dropdown/Button.js +88 -9
  239. package/dropdown/index.js +85 -163
  240. package/empty/index.js +21 -5
  241. package/form/Control.js +1 -1
  242. package/form/Form.js +159 -14
  243. package/form/FormItem.js +30 -29
  244. package/form/FormList.js +1 -1
  245. package/form/context.js +1 -1
  246. package/form/hook/useContext.js +32 -0
  247. package/form/hook/useForm.js +58 -0
  248. package/form/hook/useState.js +31 -0
  249. package/form/hook/useWatch.js +36 -0
  250. package/form/index.js +29 -106
  251. package/form/promisify.js +1 -1
  252. package/form/store.js +1 -1
  253. package/form/util.js +5 -5
  254. package/grid/Col.js +14 -13
  255. package/grid/Grid.js +23 -22
  256. package/grid/GridItem.js +23 -22
  257. package/grid/Row.js +19 -18
  258. package/{chunk/xAb6ZgqS.js → grid/hook/useResponsiveState.js} +2 -2
  259. package/hooks/index.js +38 -38
  260. package/hooks/use-watermark/utils.js +9 -0
  261. package/hooks/useComputedState.js +2 -2
  262. package/hooks/useCreate.js +2 -2
  263. package/hooks/useForceUpdate.js +2 -2
  264. package/hooks/useId.js +2 -2
  265. package/hooks/useInView.js +2 -2
  266. package/hooks/useIntersectionObserver.js +2 -2
  267. package/hooks/useInterval.js +2 -2
  268. package/hooks/useIsFirstRender.js +2 -2
  269. package/hooks/useIsomorphicLayoutEffect.js +2 -2
  270. package/hooks/useKeyboardEvent.js +2 -2
  271. package/hooks/useListenResize.js +2 -2
  272. package/hooks/useMedia.js +2 -2
  273. package/hooks/useMergeProps.js +2 -2
  274. package/hooks/useMergeValue.js +2 -2
  275. package/hooks/useOnlineStatus.js +2 -2
  276. package/hooks/useOverflowHidden.js +2 -2
  277. package/hooks/useOverrideRef.js +2 -2
  278. package/hooks/usePersistCallback.js +2 -2
  279. package/hooks/usePrefersColorSchemeDark.js +2 -2
  280. package/hooks/usePrevious.js +2 -2
  281. package/hooks/useRefs.js +2 -2
  282. package/hooks/useResizeObserver.js +2 -2
  283. package/hooks/useStateCallback.js +2 -2
  284. package/hooks/useStateWithPromise.js +2 -2
  285. package/hooks/useUpdateEffect.js +2 -2
  286. package/hooks/useVerificationCode.js +21 -21
  287. package/hooks/useWatch.js +2 -2
  288. package/hooks/useWatermark.js +72 -77
  289. package/hooks/useWindowSize.js +2 -2
  290. package/icon/addFromIconFontCn.js +31 -5
  291. package/icon/index.js +22 -48
  292. package/icon-hover/index.js +37 -5
  293. package/icons/file.js +15 -63
  294. package/image/Image.js +35 -32
  295. package/image/ImageFooter.js +44 -6
  296. package/image/ImagePreview.js +480 -34
  297. package/image/ImagePreviewArrow.js +8 -7
  298. package/image/ImagePreviewGroup.js +9 -9
  299. package/image/index.js +3 -3
  300. package/image/util/getFixTranslate.js +7 -0
  301. package/image/util/getScale.js +74 -0
  302. package/image/util/hook/useImageStatus.js +16 -0
  303. package/image/util/hook/useShowFooter.js +7 -0
  304. package/index.js +681 -614
  305. package/input/Button.js +67 -9
  306. package/input/Group.js +9 -8
  307. package/input/Input.js +158 -684
  308. package/input/InputElement.js +33 -33
  309. package/input/Number.js +2 -2
  310. package/input/Password.js +69 -11
  311. package/input/Search.js +68 -11
  312. package/input/Textarea.js +166 -14
  313. package/input/index.js +17 -13
  314. package/input-number/index.js +209 -16
  315. package/input-number/useSelectionRange.js +3 -3
  316. package/input-tag/InputTag.js +78 -72
  317. package/layout/Content.js +7 -6
  318. package/layout/Footer.js +7 -6
  319. package/layout/Header.js +5 -4
  320. package/layout/Sider.js +19 -18
  321. package/layout/index.js +21 -20
  322. package/link/index.js +15 -14
  323. package/list/Item.js +12 -11
  324. package/list/Meta.js +7 -6
  325. package/list/index.js +268 -17
  326. package/loading/index.js +13 -13
  327. package/loading/style/index.module.less.js +4 -0
  328. package/locale/en-US.js +4 -3
  329. package/locale/tr-TR.js +4 -3
  330. package/mentions/index.js +145 -11
  331. package/menu/Item.js +3 -3
  332. package/menu/Menu.js +182 -24
  333. package/menu/OverflowWrap.js +88 -8
  334. package/menu/index.js +9 -9
  335. package/menu/sub-menu/Inline.js +111 -0
  336. package/menu/sub-menu/Pop.js +120 -0
  337. package/menu/sub-menu/index.js +17 -0
  338. package/message/index.js +147 -13
  339. package/message/useMessage.js +57 -5
  340. package/modal/Confirm.js +110 -11
  341. package/modal/Modal.js +440 -20
  342. package/modal/index.js +1 -1
  343. package/modal/use-modal/Hook.js +52 -0
  344. package/modal/use-modal/index.js +68 -0
  345. package/notice/index.js +176 -17
  346. package/notification/index.js +149 -15
  347. package/notification/useNotification.js +52 -4
  348. package/overflow-ellipsis/OverflowItem.js +17 -16
  349. package/overflow-ellipsis/index.js +30 -29
  350. package/package.json +1 -1
  351. package/page-header/index.js +30 -28
  352. package/pagination/PageItem.js +16 -15
  353. package/pagination/PageJumper.js +13 -12
  354. package/pagination/PageOption.js +45 -5
  355. package/pagination/Pagination.js +244 -11
  356. package/pagination/index.js +2 -2
  357. package/picker/Input.js +47 -45
  358. package/picker/InputRange.js +53 -51
  359. package/popconfirm/index.js +10 -9
  360. package/popover/index.js +12 -11
  361. package/portal/Portal.js +7 -7
  362. package/progress/CircleProgress.js +1 -1
  363. package/progress/index.js +32 -31
  364. package/radio/Group.js +94 -14
  365. package/radio/GroupBlock.js +68 -7
  366. package/radio/Radio.js +92 -14
  367. package/radio/index.js +7 -6
  368. package/rate/index.js +31 -30
  369. package/resize-box/ResizeTrigger.js +10 -9
  370. package/resize-box/Split.js +66 -65
  371. package/resize-box/SplitGroup.js +10 -9
  372. package/resize-box/index.js +18 -17
  373. package/result/index.js +33 -32
  374. package/select/OptGroup.js +10 -10
  375. package/select/Option.js +93 -6
  376. package/select/Select.js +548 -24
  377. package/select/index.js +3 -3
  378. package/select/util.js +139 -18
  379. package/select-view/Core.js +23 -21
  380. package/select-view/index.js +7 -7
  381. package/skeleton/index.js +12 -11
  382. package/slider/Button.js +24 -23
  383. package/slider/Input.js +11 -11
  384. package/slider/hook/useInterval.js +73 -0
  385. package/slider/hook/useLegalValue.js +70 -0
  386. package/slider/index.js +220 -345
  387. package/space/index.js +38 -127
  388. package/space-/index.js +17 -16
  389. package/speech-synthesis/index.js +9 -63
  390. package/speech-synthesis/style/index.less.js +1 -0
  391. package/spin/DotLoading.js +10 -9
  392. package/spin/index.js +21 -20
  393. package/statistic/Countdown.js +16 -15
  394. package/statistic/index.js +45 -43
  395. package/statistic/util.js +1 -1
  396. package/steps/index.js +14 -13
  397. package/style.css +1 -1
  398. package/suspense-fallback-test/index.js +6 -5
  399. package/suspense-fallback-test/style/index.less.js +1 -0
  400. package/switch/index.js +43 -38
  401. package/table/Table.js +627 -21
  402. package/table/hook/useColumns.js +141 -0
  403. package/table/hook/useComponent.js +28 -0
  404. package/table/hook/useExpand.js +36 -0
  405. package/table/hook/useRowSelection.js +94 -0
  406. package/table/hook/useSorter.js +54 -0
  407. package/table/hook/useStickyClassNames.js +30 -0
  408. package/table/hook/useStickyOffsets.js +28 -0
  409. package/table/hook/useThResizable.js +39 -0
  410. package/table/index.js +28 -15
  411. package/table/summary/Cell.js +10 -0
  412. package/table/summary/Row.js +25 -0
  413. package/table/summary/context.js +5 -0
  414. package/table/summary/index.js +12 -0
  415. package/table/tbody/Td.js +180 -0
  416. package/table/tbody/Tr.js +165 -0
  417. package/table/tbody/index.js +154 -0
  418. package/table/tfoot/index.js +16 -0
  419. package/table/th-resizable/index.js +46 -0
  420. package/table/thead/Column.js +251 -0
  421. package/table/thead/index.js +129 -0
  422. package/tabs/Tab.js +169 -16
  423. package/tabs/TabContent.js +51 -6
  424. package/tabs/TabPane.js +13 -12
  425. package/tabs/hook/useDomSize.js +17 -0
  426. package/tabs/hook/useHeaderScroll.js +67 -0
  427. package/tabs/index.js +6 -6
  428. package/tabs/tab-header/DropdownIcon.js +66 -0
  429. package/tabs/tab-header/TabInk.js +66 -0
  430. package/tabs/tab-header/TabNavIcon.js +66 -0
  431. package/tabs/tab-header/TabTitle.js +78 -0
  432. package/tabs/tab-header/index.js +331 -0
  433. package/tag/index.js +32 -30
  434. package/time-picker/Picker.js +56 -55
  435. package/time-picker/RangePicker.js +14 -14
  436. package/time-picker/TimeColumn.js +1 -1
  437. package/time-picker/TimePicker.js +42 -41
  438. package/time-picker/util.js +23 -22
  439. package/timeline/Item.js +4 -3
  440. package/timeline/Timeline.js +12 -11
  441. package/tooltip/index.js +35 -33
  442. package/transfer/Item.js +104 -9
  443. package/transfer/List.js +186 -13
  444. package/transfer/index.js +181 -13
  445. package/tree/Animation.js +100 -9
  446. package/tree/Node.js +212 -13
  447. package/tree/NodeList.js +80 -6
  448. package/tree/Tree.js +591 -17
  449. package/tree/index.js +3 -2
  450. package/tree-select/List.js +122 -6
  451. package/tree-select/Select.js +258 -22
  452. package/tree-select/hook/useKeyCache.js +55 -0
  453. package/tree-select/hook/useStateValue.js +95 -0
  454. package/tree-select/hook/useTreeData.js +13 -0
  455. package/tree-select/index.js +3 -3
  456. package/trigger/getPopupStyle.js +2 -2
  457. package/trigger/index.js +27 -22
  458. package/types/common/utils/is.d.ts +2 -1
  459. package/types/pc/details/index.d.ts +4 -0
  460. package/types/pc/details/interface.d.ts +33 -0
  461. package/types/pc/index.d.ts +1 -0
  462. package/types/pc/select/interface.d.ts +3 -3
  463. package/types/pc/tree/Context.d.ts +1 -1
  464. package/types/pc/tree/interface.d.ts +2 -2
  465. package/types/pc/utils/names.d.ts +140 -134
  466. package/typography/Base.js +43 -42
  467. package/typography/EditContent.js +7 -7
  468. package/typography/Ellipsis.js +193 -23
  469. package/typography/Operations.js +4 -4
  470. package/typography/Paragraph.js +12 -11
  471. package/typography/Typography.js +8 -7
  472. package/typography/index.js +15 -10
  473. package/typography/useEllipsis.js +21 -21
  474. package/upload/TriggerNode.js +9 -8
  475. package/upload/Upload.js +126 -548
  476. package/upload/Uploader.js +11 -11
  477. package/upload/index.js +2 -2
  478. package/upload/list/PictureItem.js +119 -0
  479. package/upload/list/TextItem.js +123 -0
  480. package/upload/list/UploadProgress.js +96 -0
  481. package/upload/list/index.js +140 -0
  482. package/upload/request.js +3 -3
  483. package/upload/request_.js +5 -5
  484. package/utils/PqbCSSTransition.js +3 -3
  485. package/utils/color.js +1 -1
  486. package/utils/computeScrollIntoView.js +4 -126
  487. package/utils/constant.js +6 -6
  488. package/utils/contextHolder.js +29 -4
  489. package/utils/dayjs.js +11 -11
  490. package/utils/dom.js +7 -49
  491. package/utils/fillNBSP.js +3 -3
  492. package/utils/getHighlightText.js +1 -1
  493. package/utils/getHotkeyHandler.js +1 -1
  494. package/utils/getStringLength.js +1 -1
  495. package/utils/include.js +3 -3
  496. package/utils/index.js +280 -270
  497. package/utils/is.js +39 -39
  498. package/utils/mergeProps.js +1 -1
  499. package/utils/mergedToString.js +1 -1
  500. package/utils/names.js +4 -0
  501. package/utils/omit.js +1 -1
  502. package/utils/pad.js +3 -16
  503. package/utils/pick.js +5 -5
  504. package/utils/react19Adapter.js +1 -3
  505. package/utils/reactDOM.js +3 -3
  506. package/utils/reactTransitionGroup.js +12 -8
  507. package/utils/resizeObserverEffect.js +1 -1
  508. package/utils/scrollIntoView.js +1 -1
  509. package/utils/setDarkTheme.js +10 -30
  510. package/utils/setPrimaryColor.js +6 -29
  511. package/utils/setTheme.js +3 -3
  512. package/utils/style.js +4 -37
  513. package/utils/throttleByRaf.js +3 -14
  514. package/utils/throttleByRaf2.js +1 -1
  515. package/utils/tinycolor.js +26 -27
  516. package/utils/tween.js +4 -3
  517. package/utils/validate.js +5 -4
  518. package/utils/warning.js +3 -9
  519. package/verification-code/VerificationCode.js +25 -24
  520. package/version/index.js +1 -1
  521. package/virtual-list/VirtualList.js +278 -391
  522. package/virtual-list/util/algorithm.js +32 -0
  523. package/virtual-list/util/item.js +99 -0
  524. package/watermark/Watermark.js +17 -16
  525. package/chunk/5_U1CBIu.js +0 -8
  526. package/chunk/9TSjT7x_.js +0 -927
  527. package/chunk/B2yFlXke.js +0 -6
  528. package/chunk/B44Hj5ad.js +0 -697
  529. package/chunk/B5RFT17G.js +0 -15
  530. package/chunk/BJ9_azwQ.js +0 -1391
  531. package/chunk/BKKEev13.js +0 -11
  532. package/chunk/BKT9BFf4.js +0 -11
  533. package/chunk/BL8tIaO8.js +0 -649
  534. package/chunk/BNevupAU.js +0 -72
  535. package/chunk/BYdIoY50.js +0 -17
  536. package/chunk/BbQEqpOn.js +0 -7835
  537. package/chunk/BcCuJQY8.js +0 -214
  538. package/chunk/Bg3uJGPu.js +0 -10
  539. package/chunk/BsUZRQDT.js +0 -23
  540. package/chunk/C4OrxKE6.js +0 -18
  541. package/chunk/C8Kcc_9d.js +0 -1479
  542. package/chunk/CC---6jO.js +0 -110
  543. package/chunk/CCKr5jj1.js +0 -31
  544. package/chunk/CIRG541s.js +0 -22
  545. package/chunk/CPCJg6bv.js +0 -570
  546. package/chunk/CQ_WOOmf.js +0 -8
  547. package/chunk/CYhxqVkn.js +0 -9
  548. package/chunk/CftuXmo_.js +0 -6
  549. package/chunk/CkEaf5V0.js +0 -473
  550. package/chunk/ClM74To2.js +0 -58
  551. package/chunk/ClqoGc3r.js +0 -17
  552. package/chunk/D-Hw4x_H.js +0 -88
  553. package/chunk/D-ap9qEk.js +0 -14
  554. package/chunk/DWvmq7az.js +0 -843
  555. package/chunk/Dc-uXGtN.js +0 -178
  556. package/chunk/DxYoPlum.js +0 -50
  557. package/chunk/NPajzdOv.js +0 -27
  558. package/chunk/VSe_Wq1g.js +0 -10
  559. package/chunk/a3hR6zLw.js +0 -12
  560. package/types/common/assets/hourglass.d.ts +0 -2
package/input/Input.js CHANGED
@@ -1,738 +1,212 @@
1
- import { jsx as c, jsxs as te, Fragment as Pe } from "react/jsx-runtime";
2
- import He from "lodash/isNil";
3
- import ne from "lodash/isPlainObject";
4
- import Fe from "lodash/isString";
5
- import de, { useContext as ie, useState as se, useRef as re, useMemo as ce, useImperativeHandle as Ie, useCallback as _e, useEffect as Ne, forwardRef as Ge } from "react";
6
- import { a as le, I as je } from "../chunk/B44Hj5ad.js";
7
- import { u as Re } from "../chunk/BFTV6myl.js";
8
- import { u as me } from "../chunk/D5wldVRB.js";
9
- import O from "@unicom-cloud/utils/class-name";
10
- import { contains as Se } from "../utils/dom.js";
11
- import Ke from "../button/index.js";
12
- import qe from "./Group.js";
13
- import Ye from "./InputElement.js";
14
- import Je from "@unicom-cloud/icons/IconUiDown";
15
- import Qe from "@unicom-cloud/icons/IconUiMinus";
16
- import Xe from "@unicom-cloud/icons/IconUiPlus";
17
- import Ze from "@unicom-cloud/icons/IconUiUp";
18
- import $e from "lodash/isNumber";
19
- import { ArrowDown as et, ArrowUp as tt } from "@unicom-cloud/utils/constant/keyboardCode";
20
- import { o as ve } from "../chunk/BKKEev13.js";
21
- import { getDecimal as oe } from "../input-number/decimal.js";
22
- import nt from "../input-number/useSelectionRange.js";
23
- import rt from "@unicom-cloud/icons/IconUiEye";
24
- import at from "@unicom-cloud/icons/IconUiEyeInvisible";
25
- import { u as ot } from "../chunk/BYdIoY50.js";
26
- import st from "@unicom-cloud/icons/IconUiLoading";
27
- import Le from "@unicom-cloud/icons/IconUiSearch";
28
- import Ee from "../input-tag/InputTag.js";
29
- import it from "@unicom-cloud/icons/IconUiClose";
30
- import { u as lt } from "../chunk/B2yFlXke.js";
31
- import "../chunk/ClM74To2.js";
32
- import ut from "./autoSizeTextAreaHeight.js";
33
- import ct from "./useComposition.js";
34
- import { isPlainObject as Ae } from "@unicom-cloud/utils/is";
35
- const xe = de.forwardRef(
36
- (e, C) => {
37
- const { getPrefixCls: s } = ie(le), {
38
- className: T,
39
- style: $,
40
- placeholder: I,
41
- disabled: n,
42
- loading: U,
43
- defaultValue: v,
44
- addAfter: y,
45
- buttonProps: u,
46
- label: k,
47
- onCallback: p,
48
- ...L
49
- } = e, R = s == null ? void 0 : s("input-button"), w = y === void 0 ? /* @__PURE__ */ c(
50
- Ke,
51
- {
52
- type: "primary",
53
- disabled: n,
54
- size: L.size,
55
- loadingFixedWidth: !0,
56
- ...u,
57
- className: O(`${R}-btn`, u == null ? void 0 : u.className),
58
- onClick: (f) => {
59
- var h, E;
60
- p == null || p(a), (h = e.onClick) == null || h.call(e, f), (E = u == null ? void 0 : u.onClick) == null || E.call(u, f);
61
- },
62
- children: k ?? "确定"
63
- }
64
- ) : y, N = ne(e.maxLength) ? e.maxLength.length : e.maxLength, m = ne(e.maxLength) && e.maxLength.errorOnly ? void 0 : N, [a, g] = me("", {
65
- defaultValue: "defaultValue" in e ? Q(e.defaultValue, m) : void 0,
66
- value: "value" in e ? Q(e.value, m) : void 0
67
- });
68
- return /* @__PURE__ */ c(
69
- M,
70
- {
71
- ...L,
72
- className: O(
73
- R,
74
- w && `${R}-has-after`,
75
- T
76
- ),
77
- style: $,
78
- ref: C,
79
- defaultValue: v,
80
- placeholder: I,
81
- addAfter: w,
82
- disabled: n,
83
- onChange: (f, h) => {
84
- var E;
85
- g(f), (E = e.onChange) == null || E.call(e, f, h);
86
- }
87
- }
88
- );
89
- }
90
- );
91
- xe.displayName = "Input.Button";
92
- const dt = 200, mt = 1e3, ft = {
93
- max: 1 / 0,
94
- min: -1 / 0,
95
- step: 1,
96
- mode: "embed",
97
- parser: (e) => (e == null ? void 0 : e.replace(/[^\w.-]+/g, "")) || ""
98
- };
99
- function pt(e, C) {
100
- var Ve;
101
- const {
102
- getPrefixCls: s,
103
- size: T,
104
- componentConfig: $,
105
- rtl: I
106
- } = ie(le), n = Re(
107
- e,
108
- ft,
109
- $ == null ? void 0 : $.InputNumber
110
- ), {
111
- className: U,
112
- style: v,
113
- defaultValue: y,
114
- disabled: u,
115
- error: k,
116
- readOnly: p,
117
- strictMode: L,
118
- placeholder: R,
119
- hideControl: w,
120
- suffix: N,
121
- prefix: m,
122
- icons: a,
123
- mode: g,
124
- size: f,
125
- step: h,
126
- precision: E,
127
- min: x,
128
- max: W,
129
- parser: G,
130
- formatter: B,
131
- onBlur: A,
132
- onFocus: j,
133
- onChange: P,
134
- onKeyDown: H,
135
- ...X
136
- } = n, V = s == null ? void 0 : s("input-number"), r = f || T, z = (() => {
137
- if ($e(E)) {
138
- const t = `${h}`.split(".")[1], d = t && t.length || 0;
139
- return Math.max(d, E);
140
- }
141
- return null;
142
- })(), [q, K] = se(() => oe(
143
- "value" in n ? n.value : "defaultValue" in n ? y : void 0
144
- )), [D, Z] = se(""), [ae, Y] = se(!1), [J, F] = se(!1), l = re(null), o = re(null), b = re(!1), i = ce(() => "value" in n ? oe(n.value) : q, [n.value, q]), [_, ee] = ce(() => [oe(W), oe(x)], [W, x]);
145
- Ie(C, () => o.current, []);
146
- const fe = (t, d) => {
147
- if (K(t), !t.equals(i) && P) {
148
- const S = t.toString({
149
- safe: !0,
150
- precision: z
151
- });
152
- P(
153
- t.isEmpty ? void 0 : L ? S : t.isNaN ? NaN : Number(S),
154
- d
155
- );
156
- }
157
- }, pe = () => {
158
- l.current && clearTimeout(l.current), l.current = null;
159
- }, ue = _e(
160
- (t) => {
161
- let d = t;
162
- return d.less(ee) ? d = ee : _.less(d) && (d = _), d;
163
- },
164
- [ee, _]
165
- );
166
- Ne(() => () => pe(), []), Ne(() => {
167
- b.current = !1;
168
- }, [n.value]), Ne(() => {
169
- const t = i.less(ee) || _.less(i);
170
- t && b.current && fe(ue(i), "outOfRange"), Y(t);
171
- }, [ee, _, i, ue]);
172
- const ye = (t, d, S = !1) => {
173
- if (t.persist(), t.preventDefault(), F(!1), u || p)
174
- return;
175
- const We = i.isInvalid ? oe(x === -1 / 0 || x <= 0 && W >= 0 ? 0 : x) : i.add(d === "plus" ? h : -h);
176
- if (fe(
177
- ue(We),
178
- d === "plus" ? "increase" : "decrease"
179
- ), o.current && o.current.focus(), S) {
180
- const Be = l.current === null;
181
- l.current = setTimeout(
182
- () => t.target.dispatchEvent(t.nativeEvent),
183
- Be ? mt : dt
184
- );
185
- }
186
- }, be = ce(() => {
187
- let t;
188
- return J ? t = G ? `${G(D)}` : D : $e(z) ? t = i.toString({ safe: !0, precision: z }) : i.isInvalid ? t = "" : t = i.toString(), B ? B(t, { userTyping: J, input: D }) : t;
189
- }, [i, D, J, z, G, B]), ke = nt({
190
- inputElement: (Ve = o.current) == null ? void 0 : Ve.dom,
191
- inputValue: be
192
- }), Oe = {
193
- onChange: (t, d) => {
194
- F(!0), t = t.trim().replace(/。/g, ".");
195
- const S = G ? G(t) : t;
196
- ($e(+S) || S === "-" || !S || S === ".") && (Z(t), fe(ue(oe(S)), "manual"), ke(d));
197
- },
198
- onKeyDown: (t) => {
199
- const d = t.key;
200
- d === et.key ? (t.stopPropagation(), ye(t, "minus")) : d === tt.key && (t.stopPropagation(), ye(t, "plus")), pe(), H == null || H(t);
201
- },
202
- onFocus: (t) => {
203
- var d, S;
204
- b.current = !0, Z((S = (d = o.current) == null ? void 0 : d.dom) == null ? void 0 : S.value), j == null || j(t);
205
- },
206
- onBlur: (t) => {
207
- fe(ue(i), "outOfRange"), F(!1), A == null || A(t);
208
- }
209
- }, Ue = (t) => p ? {} : {
210
- onMouseDown: (d) => ye(d, t, !0)
211
- }, Ce = !w && g === "button", ze = !w && !p && g === "embed", ge = (t, d) => {
212
- const S = !u && (i.isInvalid || (t === "plus" ? _.isInvalid || i.less(_) : ee.isInvalid || ee.less(i)));
213
- return /* @__PURE__ */ c(
214
- "div",
215
- {
216
- className: O(`${V}-step-button`, {
217
- [`${V}-step-button-disabled`]: !S
218
- }),
219
- onMouseLeave: pe,
220
- onMouseUp: pe,
221
- ...S ? Ue(t) : {},
222
- children: d
223
- }
224
- );
225
- };
226
- return /* @__PURE__ */ c(
227
- M,
228
- {
229
- _ignorePropsFromGlobal: !0,
230
- role: "spinbutton",
231
- "aria-valuemax": W,
232
- "aria-valuemin": x,
233
- "aria-valuenow": i.isEmpty ? void 0 : i.toNumber(),
234
- ...ve(X, ["allowClear"]),
235
- ...Oe,
236
- style: v,
237
- className: O(
238
- V,
239
- `${V}-mode-${g}`,
240
- `${V}-size-${r}`,
241
- {
242
- [`${V}-rtl`]: I,
243
- [`${V}-readonly`]: p,
244
- [`${V}-illegal-value`]: !i.isEmpty && ae
245
- },
246
- U
247
- ),
248
- ref: o,
249
- size: r,
250
- error: k,
251
- disabled: u,
252
- readOnly: p,
253
- value: be,
254
- placeholder: R,
255
- prefix: m && /* @__PURE__ */ c("div", { className: `${V}-prefix`, children: m }),
256
- suffix: /* @__PURE__ */ te(Pe, { children: [
257
- ze && /* @__PURE__ */ te("div", { className: `${V}-step-layer`, children: [
258
- ge(
259
- "plus",
260
- a && a.up ? a.up : /* @__PURE__ */ c(Ze, {})
261
- ),
262
- ge(
263
- "minus",
264
- a && a.down ? a.down : /* @__PURE__ */ c(Je, {})
265
- )
266
- ] }),
267
- N && /* @__PURE__ */ c("div", { className: `${V}-suffix`, children: N })
268
- ] }),
269
- addBefore: Ce && ge(
270
- "minus",
271
- a && a.minus ? a.minus : /* @__PURE__ */ c(Qe, {})
272
- ),
273
- addAfter: Ce && ge(
274
- "plus",
275
- a && a.plus ? a.plus : /* @__PURE__ */ c(Xe, {})
276
- )
277
- }
278
- );
279
- }
280
- const we = de.forwardRef(
281
- pt
282
- );
283
- we.displayName = "InputNumber";
284
- const De = de.forwardRef(
285
- (e, C) => {
286
- const [s, T] = me(!1, {
287
- defaultValue: e.defaultVisibility,
288
- value: e.visibility
289
- }), { getPrefixCls: $ } = ie(le), I = ot(), {
290
- className: n,
291
- visibilityToggle: U = !0,
292
- onVisibilityChange: v,
293
- ...y
294
- } = e, u = $ == null ? void 0 : $("input-password"), k = O(
295
- u,
296
- {
297
- [`${u}-visibility`]: U
298
- },
299
- n
300
- ), p = (w) => {
301
- "visibility" in e || T(w), v == null || v(w);
302
- };
303
- let L = e.suffix;
304
- const R = () => {
305
- p(!s);
306
- };
307
- if (U) {
308
- const w = {
309
- onClick: R,
310
- // 预防focus丢失
311
- onMouseDown: (N) => N.preventDefault(),
312
- onMouseUp: (N) => N.preventDefault(),
313
- ...I({
314
- onPressEnter: R
315
- })
316
- };
317
- e.suffix ? L = /* @__PURE__ */ c("span", { ...w, children: e.suffix }) : L = /* @__PURE__ */ c(
318
- s ? rt : at,
319
- {
320
- ...w,
321
- focusable: void 0,
322
- "aria-hidden": void 0,
323
- // tabIndex: 0,
324
- className: `${u}-visibility-icon`
325
- }
326
- );
327
- }
328
- return /* @__PURE__ */ c(
329
- M,
330
- {
331
- ...ve(y, ["visibility", "defaultVisibility"]),
332
- type: s ? "text" : "password",
333
- className: k,
334
- ref: C,
335
- suffix: L
336
- }
337
- );
338
- }
339
- );
340
- De.displayName = "Password";
341
- const Me = de.forwardRef(
342
- (e, C) => {
343
- const { getPrefixCls: s } = ie(le), {
344
- className: T,
345
- disabled: $,
346
- searchButton: I,
347
- loading: n,
348
- addAfter: U,
349
- suffix: v,
350
- buttonProps: y,
351
- ...u
352
- } = e, k = s == null ? void 0 : s("input-search"), p = ne(e.maxLength) ? e.maxLength.length : e.maxLength, L = ne(e.maxLength) && e.maxLength.errorOnly ? void 0 : p, [R, w] = me("", {
353
- defaultValue: "defaultValue" in e ? Q(e.defaultValue, L) : void 0,
354
- value: "value" in e ? Q(e.value, L) : void 0
355
- }), N = () => {
356
- var m;
357
- $ || (m = e.onSearch) == null || m.call(e, R);
358
- };
359
- return /* @__PURE__ */ c(
360
- xe,
361
- {
362
- ...ve(u, ["onSearch"]),
363
- disabled: $,
364
- className: O(
365
- k,
366
- I && `${k}-button`,
367
- T
368
- ),
369
- ref: C,
370
- label: I !== !0 && I,
371
- addAfter: I ? U : null,
372
- suffix: v === void 0 ? I ? null : n ? /* @__PURE__ */ c(st, {}) : /* @__PURE__ */ c(Le, { onClick: N }) : v,
373
- buttonProps: {
374
- className: `${k}-btn`,
375
- loading: n,
376
- icon: I === !0 && !n && /* @__PURE__ */ c(Le, {}),
377
- ...y,
378
- onClick(m) {
379
- var a;
380
- N(), (a = y == null ? void 0 : y.onClick) == null || a.call(y, m);
381
- }
382
- },
383
- onChange: (m, a) => {
384
- var g;
385
- w(m), (g = e.onChange) == null || g.call(e, m, a);
386
- },
387
- onPressEnter: (m) => {
388
- var a;
389
- N(), (a = e.onPressEnter) == null || a.call(e, m);
390
- }
391
- }
392
- );
393
- }
394
- );
395
- Me.displayName = "Search";
396
- const gt = (e, C) => {
397
- const {
398
- className: s,
399
- style: T,
400
- wrapperStyle: $,
401
- placeholder: I,
402
- disabled: n,
403
- error: U,
404
- maxLength: v,
405
- showWordLimit: y,
406
- allowClear: u,
407
- onChange: k,
408
- onClear: p,
409
- onKeyDown: L,
410
- onPressEnter: R,
411
- status: w,
412
- clearIcon: N,
413
- ...m
414
- } = e, a = Ae(v) ? v.length : v, g = Ae(v) ? v.errorOnly ? void 0 : v.length : v, f = re(), [h, E] = se({}), [x, W] = me("", {
415
- defaultValue: "defaultValue" in e ? Q(e.defaultValue, g) : void 0,
416
- value: "value" in e ? Q(e.value, g) : void 0
417
- }), {
418
- compositionValue: G,
419
- compositionHandler: B,
420
- valueChangeHandler: A,
421
- keyDownHandler: j,
422
- triggerValueChangeCallback: P
423
- } = ct({
424
- value: x,
425
- maxLength: g,
426
- onChange: k,
427
- onKeyDown: L,
428
- onPressEnter: R,
429
- beforeTriggerValueChangeCallback: (l) => {
430
- !("value" in e) && (g === void 0 || l.length <= g) && W(l);
431
- }
432
- }), H = G || x || "", { getPrefixCls: X, rtl: V } = ie(le), r = X == null ? void 0 : X("textarea");
433
- n && (h.resize = "none");
434
- const z = () => {
435
- if (f.current && f.current.focus) {
436
- if (f.current.setSelectionRange) {
437
- const l = f.current.textContent.length;
438
- f.current.setSelectionRange(l, l);
439
- }
440
- f.current.focus();
441
- }
442
- }, q = () => {
443
- const l = ut(
444
- e.autoSize,
445
- f.current
446
- );
447
- l && E(l);
448
- }, K = (l) => {
449
- l.stopPropagation(), z(), P("", l), p == null || p();
450
- };
451
- lt(() => {
452
- q();
453
- }, [H]), Ie(
454
- C,
455
- () => ({
456
- dom: f.current,
457
- focus: () => {
458
- z();
459
- },
460
- blur: () => {
461
- var l, o;
462
- (o = (l = f.current) == null ? void 0 : l.blur) == null || o.call(l);
463
- },
464
- getRootDOMNode: () => f.current
465
- }),
466
- []
467
- );
468
- const D = x ? x.length : 0, Z = a && y || u, ae = ce(() => !g && a ? D > a : !1, [D, a, g]), Y = w || (U || ae ? "error" : void 0), J = O(
469
- r,
470
- {
471
- [`${r}-${Y}`]: Y,
472
- // [`${prefixCls}-error`]: error || lengthError || status === 'error',
473
- [`${r}-disabled`]: n,
474
- [`${r}-rtl`]: V
475
- },
476
- s
477
- ), F = /* @__PURE__ */ c(
478
- "textarea",
479
- {
480
- ...ve(m, ["autoSize", "defaultValue"]),
481
- maxLength: g,
482
- ref: f,
483
- style: { ...T, ...h },
484
- className: J,
485
- placeholder: I,
486
- disabled: n,
487
- value: H,
488
- onChange: A,
489
- onKeyDown: j,
490
- onCompositionStart: B,
491
- onCompositionUpdate: B,
492
- onCompositionEnd: B
493
- }
494
- );
495
- if (Z) {
496
- const l = !n && u && x, [o, b] = V ? [a, D] : [D, a];
497
- return /* @__PURE__ */ te(
498
- "div",
499
- {
500
- className: O(`${r}-wrapper`, {
501
- [`${r}-clear-wrapper`]: u,
502
- [`${r}-wrapper-rtl`]: V
503
- }),
504
- style: $,
505
- children: [
506
- F,
507
- l ? N !== void 0 ? /* @__PURE__ */ c(
508
- "span",
509
- {
510
- className: `${r}-clear-icon`,
511
- onClick: K,
512
- onMouseDown: (i) => {
513
- i.preventDefault();
514
- },
515
- children: N
516
- }
517
- ) : /* @__PURE__ */ c(je, { className: `${r}-clear-icon`, children: /* @__PURE__ */ c(
518
- it,
519
- {
520
- onClick: K,
521
- onMouseDown: (i) => {
522
- i.preventDefault();
523
- }
524
- }
525
- ) }) : null,
526
- a && y && /* @__PURE__ */ te(
527
- "span",
528
- {
529
- className: O(`${r}-word-limit`, {
530
- [`${r}-word-limit-error`]: ae
531
- }),
532
- children: [
533
- o,
534
- "/",
535
- b
536
- ]
537
- }
538
- )
539
- ]
540
- }
541
- );
542
- }
543
- return F;
544
- }, Te = de.forwardRef(gt);
545
- Te.displayName = "TextArea";
546
- const ht = (e) => {
547
- e.target.tagName === "INPUT" || e.preventDefault();
548
- }, he = (e, C, s = {}, T) => C ? /* @__PURE__ */ c("span", { style: s, className: e, onClick: T, children: C }) : null;
549
- function Q(e, C) {
550
- let s = e || "";
551
- return Fe(e) || He(e) || (s = String(e)), C && (s = s.slice(0, C)), s;
1
+ import { jsxs as A, jsx as I } from "react/jsx-runtime";
2
+ import ar from "lodash/isNil";
3
+ import F from "lodash/isPlainObject";
4
+ import ur from "lodash/isString";
5
+ import { forwardRef as ir, useContext as pr, useState as lr, useRef as V, useImperativeHandle as cr, useMemo as fr } from "react";
6
+ import "../config-provider/ConfigProvider.js";
7
+ import mr from "../components/common/hooks/useMergeProps.js";
8
+ import dr from "../components/common/hooks/useMergeValue.js";
9
+ import $ from "@unicom-cloud/utils/class-name";
10
+ import { contains as q } from "../components/common/utils/dom.js";
11
+ import K from "./Button.js";
12
+ import gr from "./Group.js";
13
+ import hr from "./InputElement.js";
14
+ import Q from "../input-number/index.js";
15
+ import wr from "./Password.js";
16
+ import $r from "./Search.js";
17
+ import X from "../input-tag/InputTag.js";
18
+ import xr from "./Textarea.js";
19
+ import Ir from "../config-provider/context.js";
20
+ const Nr = (o) => {
21
+ o.target.tagName === "INPUT" || o.preventDefault();
22
+ }, x = (o, p, a = {}, N) => p ? /* @__PURE__ */ I("span", { style: a, className: o, onClick: N, children: p }) : null;
23
+ function J(o, p) {
24
+ let a = o || "";
25
+ return ur(o) || ar(o) || (a = String(o)), p && (a = a.slice(0, p)), a;
552
26
  }
553
- function vt(e, C) {
27
+ function br(o, p) {
554
28
  const {
555
- getPrefixCls: s,
556
- size: T,
557
- componentConfig: $,
558
- rtl: I
559
- } = ie(le), n = Re(
560
- e,
29
+ getPrefixCls: a,
30
+ size: N,
31
+ componentConfig: b,
32
+ rtl: C
33
+ } = pr(Ir), e = mr(
34
+ o,
561
35
  {},
562
- $ == null ? void 0 : $.Input
36
+ b == null ? void 0 : b.Input
563
37
  ), {
564
- className: U,
565
- style: v,
566
- addBefore: y,
567
- addAfter: u,
568
- suffix: k,
569
- prefix: p,
570
- beforeStyle: L,
571
- afterStyle: R,
572
- height: w,
573
- disabled: N,
574
- maxLength: m,
575
- showWordLimit: a,
576
- allowClear: g,
577
- autoWidth: f
578
- } = n, h = f ? {
38
+ className: D,
39
+ style: Y,
40
+ addBefore: z,
41
+ addAfter: L,
42
+ suffix: Z,
43
+ prefix: W,
44
+ beforeStyle: _,
45
+ afterStyle: rr,
46
+ height: j,
47
+ disabled: k,
48
+ maxLength: c,
49
+ showWordLimit: er,
50
+ allowClear: v,
51
+ autoWidth: S
52
+ } = e, u = S ? {
579
53
  minWidth: 0,
580
54
  maxWidth: "100%",
581
- ...ne(f) ? f : {}
582
- } : null, E = {
583
- minWidth: h == null ? void 0 : h.minWidth,
584
- maxWidth: h == null ? void 0 : h.maxWidth,
585
- width: h && "auto",
586
- ...v
587
- }, x = ne(m) ? m.length : m, W = ne(m) && m.errorOnly ? void 0 : x, [G, B] = se(!1), A = re(), j = re(), P = re(), [H, X] = me("", {
588
- defaultValue: "defaultValue" in n ? Q(n.defaultValue, W) : void 0,
589
- value: "value" in n ? Q(n.value, W) : void 0
55
+ ...F(S) ? S : {}
56
+ } : null, y = {
57
+ minWidth: u == null ? void 0 : u.minWidth,
58
+ maxWidth: u == null ? void 0 : u.maxWidth,
59
+ width: u && "auto",
60
+ ...Y
61
+ }, l = F(c) ? c.length : c, d = F(c) && c.errorOnly ? void 0 : l, [tr, E] = lr(!1), i = V(), T = V(), f = V(), [M, nr] = dr("", {
62
+ defaultValue: "defaultValue" in e ? J(e.defaultValue, d) : void 0,
63
+ value: "value" in e ? J(e.value, d) : void 0
590
64
  });
591
- Ie(
592
- C,
65
+ cr(
66
+ p,
593
67
  () => {
594
- var o, b, i;
68
+ var t, n, m;
595
69
  return {
596
- focus: (o = A.current) == null ? void 0 : o.focus,
597
- blur: (b = A.current) == null ? void 0 : b.blur,
598
- dom: (i = A.current) == null ? void 0 : i.dom,
70
+ focus: (t = i.current) == null ? void 0 : t.focus,
71
+ blur: (n = i.current) == null ? void 0 : n.blur,
72
+ dom: (m = i.current) == null ? void 0 : m.dom,
599
73
  // 保持之前逻辑
600
74
  getRootDOMNode: () => {
601
- var _;
602
- return j.current || ((_ = A.current) == null ? void 0 : _.dom);
75
+ var U;
76
+ return T.current || ((U = i.current) == null ? void 0 : U.dom);
603
77
  }
604
78
  };
605
79
  },
606
80
  []
607
81
  );
608
- const V = (o, b) => {
609
- var i;
610
- "value" in n || X(o), (i = n.onChange) == null || i.call(n, o, b);
611
- }, r = s == null ? void 0 : s("input"), z = n.size || T, q = "height" in n;
612
- let K = k;
613
- const D = H ? H.length : 0, Z = ce(() => !W && x ? D > x : !1, [D, x, W]);
614
- if (x && a) {
615
- const [o, b] = I ? [x, D] : [D, x];
616
- K = /* @__PURE__ */ te(
82
+ const or = (t, n) => {
83
+ var m;
84
+ "value" in e || nr(t), (m = e.onChange) == null || m.call(e, t, n);
85
+ }, r = a == null ? void 0 : a("input"), g = e.size || N, R = "height" in e;
86
+ let h = Z;
87
+ const w = M ? M.length : 0, G = fr(() => !d && l ? w > l : !1, [w, l, d]);
88
+ if (l && er) {
89
+ const [t, n] = C ? [l, w] : [w, l];
90
+ h = /* @__PURE__ */ A(
617
91
  "span",
618
92
  {
619
- className: O(`${r}-word-limit`, {
620
- [`${r}-word-limit-error`]: Z
93
+ className: $(`${r}-word-limit`, {
94
+ [`${r}-word-limit-error`]: G
621
95
  }),
622
96
  children: [
623
- o,
97
+ t,
624
98
  "/",
625
- b
99
+ n
626
100
  ]
627
101
  }
628
102
  );
629
103
  }
630
- const ae = O(
104
+ const sr = $(
631
105
  `${r}-group-wrapper`,
632
- `${r}-group-wrapper-${z}`,
106
+ `${r}-group-wrapper-${g}`,
633
107
  {
634
- [`${r}-custom-height`]: q,
635
- [`${r}-has-suffix`]: K,
636
- [`${r}-group-wrapper-disabled`]: N,
637
- [`${r}-group-wrapper-rtl`]: I,
638
- [`${r}-group-wrapper-autowidth`]: h
108
+ [`${r}-custom-height`]: R,
109
+ [`${r}-has-suffix`]: h,
110
+ [`${r}-group-wrapper-disabled`]: k,
111
+ [`${r}-group-wrapper-rtl`]: C,
112
+ [`${r}-group-wrapper-autowidth`]: u
639
113
  },
640
- U
641
- ), Y = n.status || (n.error || Z ? "error" : void 0), J = y || u || K || p, F = /* @__PURE__ */ c(
642
- Ye,
114
+ D
115
+ ), B = e.status || (e.error || G ? "error" : void 0), O = z || L || h || W, P = /* @__PURE__ */ I(
116
+ hr,
643
117
  {
644
- ref: A,
645
- ...n,
646
- autoFitWidth: !!h,
647
- style: E,
648
- status: Y,
649
- onFocus: (o) => {
650
- var b;
651
- B(!0), (b = n.onFocus) == null || b.call(n, o);
118
+ ref: i,
119
+ ...e,
120
+ autoFitWidth: !!u,
121
+ style: y,
122
+ status: B,
123
+ onFocus: (t) => {
124
+ var n;
125
+ E(!0), (n = e.onFocus) == null || n.call(e, t);
652
126
  },
653
- onBlur: (o) => {
654
- var b;
655
- B(!1), (b = n.onBlur) == null || b.call(n, o);
127
+ onBlur: (t) => {
128
+ var n;
129
+ E(!1), (n = e.onBlur) == null || n.call(e, t);
656
130
  },
657
- onChange: V,
131
+ onChange: or,
658
132
  prefixCls: r,
659
- value: H,
660
- hasParent: !!J || g,
661
- size: z
133
+ value: M,
134
+ hasParent: !!O || v,
135
+ size: g
662
136
  }
663
- ), l = O(`${r}-inner-wrapper`, {
664
- [`${r}-inner-wrapper-${Y}`]: Y,
665
- [`${r}-inner-wrapper-disabled`]: N,
666
- [`${r}-inner-wrapper-focus`]: G,
667
- [`${r}-inner-wrapper-has-prefix`]: p,
668
- [`${r}-inner-wrapper-${z}`]: z,
669
- [`${r}-clear-wrapper`]: g,
670
- [`${r}-inner-wrapper-rtl`]: I
137
+ ), H = $(`${r}-inner-wrapper`, {
138
+ [`${r}-inner-wrapper-${B}`]: B,
139
+ [`${r}-inner-wrapper-disabled`]: k,
140
+ [`${r}-inner-wrapper-focus`]: tr,
141
+ [`${r}-inner-wrapper-has-prefix`]: W,
142
+ [`${r}-inner-wrapper-${g}`]: g,
143
+ [`${r}-clear-wrapper`]: v,
144
+ [`${r}-inner-wrapper-rtl`]: C
671
145
  });
672
- return J ? /* @__PURE__ */ c(
146
+ return O ? /* @__PURE__ */ I(
673
147
  "div",
674
148
  {
675
- ref: j,
676
- className: ae,
677
- style: { ...E, ...q ? { height: w } : {} },
678
- children: /* @__PURE__ */ te("span", { className: `${r}-group`, children: [
679
- he(`${r}-group-addbefore`, y, L),
680
- /* @__PURE__ */ te(
149
+ ref: T,
150
+ className: sr,
151
+ style: { ...y, ...R ? { height: j } : {} },
152
+ children: /* @__PURE__ */ A("span", { className: `${r}-group`, children: [
153
+ x(`${r}-group-addbefore`, z, _),
154
+ /* @__PURE__ */ A(
681
155
  "span",
682
156
  {
683
- className: l,
684
- ref: P,
685
- onMouseDown: (o) => {
686
- o.target.tagName !== "INPUT" && P.current && Se(P.current, o.target) && o.preventDefault();
157
+ className: H,
158
+ ref: f,
159
+ onMouseDown: (t) => {
160
+ t.target.tagName !== "INPUT" && f.current && q(f.current, t.target) && t.preventDefault();
687
161
  },
688
- onClick: (o) => {
689
- P.current && Se(P.current, o.target) && A.current && A.current.focus();
162
+ onClick: (t) => {
163
+ f.current && q(f.current, t.target) && i.current && i.current.focus();
690
164
  },
691
165
  children: [
692
- he(`${r}-group-prefix`, p),
693
- F,
694
- he(`${r}-group-suffix`, K)
166
+ x(`${r}-group-prefix`, W),
167
+ P,
168
+ x(`${r}-group-suffix`, h)
695
169
  ]
696
170
  }
697
171
  ),
698
- he(`${r}-group-addafter`, u, R)
172
+ x(`${r}-group-addafter`, L, rr)
699
173
  ] })
700
174
  }
701
- ) : g ? /* @__PURE__ */ c(
175
+ ) : v ? /* @__PURE__ */ I(
702
176
  "span",
703
177
  {
704
- ref: j,
705
- className: O(U, l),
706
- style: { ...E, ...q ? { height: w } : {} },
707
- onMouseDown: ht,
178
+ ref: T,
179
+ className: $(D, H),
180
+ style: { ...y, ...R ? { height: j } : {} },
181
+ onMouseDown: Nr,
708
182
  onClick: () => {
709
- A.current && A.current.focus();
183
+ i.current && i.current.focus();
710
184
  },
711
- children: F
185
+ children: P
712
186
  }
713
- ) : F;
187
+ ) : P;
714
188
  }
715
- const xt = Ge(vt), M = xt;
716
- M.displayName = "Input";
717
- M.Search = Me;
718
- M.Button = xe;
719
- M.InputButton = xe;
720
- M.TextArea = Te;
721
- M.Password = De;
722
- M.Number = we;
723
- M.InputNumber = we;
724
- M.Tag = Ee;
725
- M.InputTag = Ee;
726
- M.Group = qe;
189
+ const Cr = ir(br), s = Cr;
190
+ s.displayName = "Input";
191
+ s.Search = $r;
192
+ s.Button = K;
193
+ s.InputButton = K;
194
+ s.TextArea = xr;
195
+ s.Password = wr;
196
+ s.Number = Q;
197
+ s.InputNumber = Q;
198
+ s.Tag = X;
199
+ s.InputTag = X;
200
+ s.Group = gr;
727
201
  export {
728
- xe as InputButton,
729
- qe as InputGroup,
730
- we as InputNumber,
731
- De as InputPassword,
732
- Me as InputSearch,
733
- Ee as InputTag,
734
- Te as InputTextArea,
735
- Te as TextArea,
736
- M as default,
737
- Q as formatValue
202
+ K as InputButton,
203
+ gr as InputGroup,
204
+ Q as InputNumber,
205
+ wr as InputPassword,
206
+ $r as InputSearch,
207
+ X as InputTag,
208
+ xr as InputTextArea,
209
+ xr as TextArea,
210
+ s as default,
211
+ J as formatValue
738
212
  };