@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/chunk/9TSjT7x_.js DELETED
@@ -1,927 +0,0 @@
1
- function u(r, t) {
2
- fe(r) && (r = "100%");
3
- const e = le(r);
4
- return r = t === 360 ? r : Math.min(t, Math.max(0, parseFloat(r))), e && (r = parseInt(String(r * t), 10) / 100), Math.abs(r - t) < 1e-6 ? 1 : (t === 360 ? r = (r < 0 ? r % t + t : r % t) / parseFloat(String(t)) : r = r % t / parseFloat(String(t)), r);
5
- }
6
- function A(r) {
7
- return Math.min(1, Math.max(0, r));
8
- }
9
- function fe(r) {
10
- return typeof r == "string" && r.indexOf(".") !== -1 && parseFloat(r) === 1;
11
- }
12
- function le(r) {
13
- return typeof r == "string" && r.indexOf("%") !== -1;
14
- }
15
- function L(r) {
16
- return r = parseFloat(r), (isNaN(r) || r < 0 || r > 1) && (r = 1), r;
17
- }
18
- function S(r) {
19
- return Number(r) <= 1 ? `${Number(r) * 100}%` : r;
20
- }
21
- function b(r) {
22
- return r.length === 1 ? "0" + r : String(r);
23
- }
24
- function ge(r, t, e) {
25
- return {
26
- r: u(r, 255) * 255,
27
- g: u(t, 255) * 255,
28
- b: u(e, 255) * 255
29
- };
30
- }
31
- function q(r, t, e) {
32
- r = u(r, 255), t = u(t, 255), e = u(e, 255);
33
- const a = Math.max(r, t, e), n = Math.min(r, t, e);
34
- let s = 0, i = 0;
35
- const o = (a + n) / 2;
36
- if (a === n)
37
- i = 0, s = 0;
38
- else {
39
- const f = a - n;
40
- switch (i = o > 0.5 ? f / (2 - a - n) : f / (a + n), a) {
41
- case r:
42
- s = (t - e) / f + (t < e ? 6 : 0);
43
- break;
44
- case t:
45
- s = (e - r) / f + 2;
46
- break;
47
- case e:
48
- s = (r - t) / f + 4;
49
- break;
50
- }
51
- s /= 6;
52
- }
53
- return { h: s, s: i, l: o };
54
- }
55
- function H(r, t, e) {
56
- return e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? r + (t - r) * (6 * e) : e < 1 / 2 ? t : e < 2 / 3 ? r + (t - r) * (2 / 3 - e) * 6 : r;
57
- }
58
- function ce(r, t, e) {
59
- let a, n, s;
60
- if (r = u(r, 360), t = u(t, 100), e = u(e, 100), t === 0)
61
- n = e, s = e, a = e;
62
- else {
63
- const i = e < 0.5 ? e * (1 + t) : e + t - e * t, o = 2 * e - i;
64
- a = H(o, i, r + 1 / 3), n = H(o, i, r), s = H(o, i, r - 1 / 3);
65
- }
66
- return { r: a * 255, g: n * 255, b: s * 255 };
67
- }
68
- function R(r, t, e) {
69
- r = u(r, 255), t = u(t, 255), e = u(e, 255);
70
- const a = Math.max(r, t, e), n = Math.min(r, t, e);
71
- let s = 0;
72
- const i = a, o = a - n, f = a === 0 ? 0 : o / a;
73
- if (a === n)
74
- s = 0;
75
- else {
76
- switch (a) {
77
- case r:
78
- s = (t - e) / o + (t < e ? 6 : 0);
79
- break;
80
- case t:
81
- s = (e - r) / o + 2;
82
- break;
83
- case e:
84
- s = (r - t) / o + 4;
85
- break;
86
- }
87
- s /= 6;
88
- }
89
- return { h: s, s: f, v: i };
90
- }
91
- function de(r, t, e) {
92
- r = u(r, 360) * 6, t = u(t, 100), e = u(e, 100);
93
- const a = Math.floor(r), n = r - a, s = e * (1 - t), i = e * (1 - n * t), o = e * (1 - (1 - n) * t), f = a % 6, d = [e, i, s, s, o, e][f], m = [o, e, e, i, s, s][f], M = [s, s, o, e, e, i][f];
94
- return { r: d * 255, g: m * 255, b: M * 255 };
95
- }
96
- function T(r, t, e, a) {
97
- const n = [
98
- b(Math.round(r).toString(16)),
99
- b(Math.round(t).toString(16)),
100
- b(Math.round(e).toString(16))
101
- ];
102
- return a && n[0].startsWith(n[0].charAt(1)) && n[1].startsWith(n[1].charAt(1)) && n[2].startsWith(n[2].charAt(1)) ? n[0].charAt(0) + n[1].charAt(0) + n[2].charAt(0) : n.join("");
103
- }
104
- function be(r, t, e, a, n) {
105
- const s = [
106
- b(Math.round(r).toString(16)),
107
- b(Math.round(t).toString(16)),
108
- b(Math.round(e).toString(16)),
109
- b(V(a))
110
- ];
111
- return n && s[0].startsWith(s[0].charAt(1)) && s[1].startsWith(s[1].charAt(1)) && s[2].startsWith(s[2].charAt(1)) && s[3].startsWith(s[3].charAt(1)) ? s[0].charAt(0) + s[1].charAt(0) + s[2].charAt(0) + s[3].charAt(0) : s.join("");
112
- }
113
- function Ae(r, t, e, a) {
114
- return [
115
- b(V(a)),
116
- b(Math.round(r).toString(16)),
117
- b(Math.round(t).toString(16)),
118
- b(Math.round(e).toString(16))
119
- ].join("");
120
- }
121
- function me(r, t, e, a) {
122
- const n = r / 100, s = t / 100, i = e / 100, o = a / 100, f = 255 * (1 - n) * (1 - o), d = 255 * (1 - s) * (1 - o), m = 255 * (1 - i) * (1 - o);
123
- return { r: f, g: d, b: m };
124
- }
125
- function O(r, t, e) {
126
- let a = 1 - r / 255, n = 1 - t / 255, s = 1 - e / 255, i = Math.min(a, n, s);
127
- return i === 1 ? (a = 0, n = 0, s = 0) : (a = (a - i) / (1 - i) * 100, n = (n - i) / (1 - i) * 100, s = (s - i) / (1 - i) * 100), i *= 100, {
128
- c: Math.round(a),
129
- m: Math.round(n),
130
- y: Math.round(s),
131
- k: Math.round(i)
132
- };
133
- }
134
- function V(r) {
135
- return Math.round(parseFloat(r) * 255).toString(16);
136
- }
137
- function P(r) {
138
- return g(r) / 255;
139
- }
140
- function g(r) {
141
- return parseInt(r, 16);
142
- }
143
- function pe(r) {
144
- return {
145
- r: r >> 16,
146
- g: (r & 65280) >> 8,
147
- b: r & 255
148
- };
149
- }
150
- const C = {
151
- aliceblue: "#f0f8ff",
152
- antiquewhite: "#faebd7",
153
- aqua: "#00ffff",
154
- aquamarine: "#7fffd4",
155
- azure: "#f0ffff",
156
- beige: "#f5f5dc",
157
- bisque: "#ffe4c4",
158
- black: "#000000",
159
- blanchedalmond: "#ffebcd",
160
- blue: "#0000ff",
161
- blueviolet: "#8a2be2",
162
- brown: "#a52a2a",
163
- burlywood: "#deb887",
164
- cadetblue: "#5f9ea0",
165
- chartreuse: "#7fff00",
166
- chocolate: "#d2691e",
167
- coral: "#ff7f50",
168
- cornflowerblue: "#6495ed",
169
- cornsilk: "#fff8dc",
170
- crimson: "#dc143c",
171
- cyan: "#00ffff",
172
- darkblue: "#00008b",
173
- darkcyan: "#008b8b",
174
- darkgoldenrod: "#b8860b",
175
- darkgray: "#a9a9a9",
176
- darkgreen: "#006400",
177
- darkgrey: "#a9a9a9",
178
- darkkhaki: "#bdb76b",
179
- darkmagenta: "#8b008b",
180
- darkolivegreen: "#556b2f",
181
- darkorange: "#ff8c00",
182
- darkorchid: "#9932cc",
183
- darkred: "#8b0000",
184
- darksalmon: "#e9967a",
185
- darkseagreen: "#8fbc8f",
186
- darkslateblue: "#483d8b",
187
- darkslategray: "#2f4f4f",
188
- darkslategrey: "#2f4f4f",
189
- darkturquoise: "#00ced1",
190
- darkviolet: "#9400d3",
191
- deeppink: "#ff1493",
192
- deepskyblue: "#00bfff",
193
- dimgray: "#696969",
194
- dimgrey: "#696969",
195
- dodgerblue: "#1e90ff",
196
- firebrick: "#b22222",
197
- floralwhite: "#fffaf0",
198
- forestgreen: "#228b22",
199
- fuchsia: "#ff00ff",
200
- gainsboro: "#dcdcdc",
201
- ghostwhite: "#f8f8ff",
202
- goldenrod: "#daa520",
203
- gold: "#ffd700",
204
- gray: "#808080",
205
- green: "#008000",
206
- greenyellow: "#adff2f",
207
- grey: "#808080",
208
- honeydew: "#f0fff0",
209
- hotpink: "#ff69b4",
210
- indianred: "#cd5c5c",
211
- indigo: "#4b0082",
212
- ivory: "#fffff0",
213
- khaki: "#f0e68c",
214
- lavenderblush: "#fff0f5",
215
- lavender: "#e6e6fa",
216
- lawngreen: "#7cfc00",
217
- lemonchiffon: "#fffacd",
218
- lightblue: "#add8e6",
219
- lightcoral: "#f08080",
220
- lightcyan: "#e0ffff",
221
- lightgoldenrodyellow: "#fafad2",
222
- lightgray: "#d3d3d3",
223
- lightgreen: "#90ee90",
224
- lightgrey: "#d3d3d3",
225
- lightpink: "#ffb6c1",
226
- lightsalmon: "#ffa07a",
227
- lightseagreen: "#20b2aa",
228
- lightskyblue: "#87cefa",
229
- lightslategray: "#778899",
230
- lightslategrey: "#778899",
231
- lightsteelblue: "#b0c4de",
232
- lightyellow: "#ffffe0",
233
- lime: "#00ff00",
234
- limegreen: "#32cd32",
235
- linen: "#faf0e6",
236
- magenta: "#ff00ff",
237
- maroon: "#800000",
238
- mediumaquamarine: "#66cdaa",
239
- mediumblue: "#0000cd",
240
- mediumorchid: "#ba55d3",
241
- mediumpurple: "#9370db",
242
- mediumseagreen: "#3cb371",
243
- mediumslateblue: "#7b68ee",
244
- mediumspringgreen: "#00fa9a",
245
- mediumturquoise: "#48d1cc",
246
- mediumvioletred: "#c71585",
247
- midnightblue: "#191970",
248
- mintcream: "#f5fffa",
249
- mistyrose: "#ffe4e1",
250
- moccasin: "#ffe4b5",
251
- navajowhite: "#ffdead",
252
- navy: "#000080",
253
- oldlace: "#fdf5e6",
254
- olive: "#808000",
255
- olivedrab: "#6b8e23",
256
- orange: "#ffa500",
257
- orangered: "#ff4500",
258
- orchid: "#da70d6",
259
- palegoldenrod: "#eee8aa",
260
- palegreen: "#98fb98",
261
- paleturquoise: "#afeeee",
262
- palevioletred: "#db7093",
263
- papayawhip: "#ffefd5",
264
- peachpuff: "#ffdab9",
265
- peru: "#cd853f",
266
- pink: "#ffc0cb",
267
- plum: "#dda0dd",
268
- powderblue: "#b0e0e6",
269
- purple: "#800080",
270
- rebeccapurple: "#663399",
271
- red: "#ff0000",
272
- rosybrown: "#bc8f8f",
273
- royalblue: "#4169e1",
274
- saddlebrown: "#8b4513",
275
- salmon: "#fa8072",
276
- sandybrown: "#f4a460",
277
- seagreen: "#2e8b57",
278
- seashell: "#fff5ee",
279
- sienna: "#a0522d",
280
- silver: "#c0c0c0",
281
- skyblue: "#87ceeb",
282
- slateblue: "#6a5acd",
283
- slategray: "#708090",
284
- slategrey: "#708090",
285
- snow: "#fffafa",
286
- springgreen: "#00ff7f",
287
- steelblue: "#4682b4",
288
- tan: "#d2b48c",
289
- teal: "#008080",
290
- thistle: "#d8bfd8",
291
- tomato: "#ff6347",
292
- turquoise: "#40e0d0",
293
- violet: "#ee82ee",
294
- wheat: "#f5deb3",
295
- white: "#ffffff",
296
- whitesmoke: "#f5f5f5",
297
- yellow: "#ffff00",
298
- yellowgreen: "#9acd32"
299
- };
300
- function ye(r) {
301
- let t = { r: 0, g: 0, b: 0 }, e = 1, a = null, n = null, s = null, i = !1, o = !1;
302
- return typeof r == "string" && (r = ve(r)), typeof r == "object" && (l(r.r) && l(r.g) && l(r.b) ? (t = ge(r.r, r.g, r.b), i = !0, o = String(r.r).slice(-1) === "%" ? "prgb" : "rgb") : l(r.h) && l(r.s) && l(r.v) ? (a = S(r.s), n = S(r.v), t = de(r.h, a, n), i = !0, o = "hsv") : l(r.h) && l(r.s) && l(r.l) ? (a = S(r.s), s = S(r.l), t = ce(r.h, a, s), i = !0, o = "hsl") : l(r.c) && l(r.m) && l(r.y) && l(r.k) && (t = me(r.c, r.m, r.y, r.k), i = !0, o = "cmyk"), Object.prototype.hasOwnProperty.call(r, "a") && (e = r.a)), e = L(e), {
303
- ok: i,
304
- format: r.format || o,
305
- r: Math.min(255, Math.max(t.r, 0)),
306
- g: Math.min(255, Math.max(t.g, 0)),
307
- b: Math.min(255, Math.max(t.b, 0)),
308
- a: e
309
- };
310
- }
311
- const we = "[-\\+]?\\d+%?", ke = "[-\\+]?\\d*\\.\\d+%?", y = "(?:" + ke + ")|(?:" + we + ")", E = "[\\s|\\(]+(" + y + ")[,|\\s]+(" + y + ")[,|\\s]+(" + y + ")\\s*\\)?", F = (
312
- // eslint-disable-next-line prettier/prettier
313
- "[\\s|\\(]+(" + y + ")[,|\\s]+(" + y + ")[,|\\s]+(" + y + ")[,|\\s]+(" + y + ")\\s*\\)?"
314
- ), c = {
315
- CSS_UNIT: new RegExp(y),
316
- rgb: new RegExp("rgb" + E),
317
- rgba: new RegExp("rgba" + F),
318
- hsl: new RegExp("hsl" + E),
319
- hsla: new RegExp("hsla" + F),
320
- hsv: new RegExp("hsv" + E),
321
- hsva: new RegExp("hsva" + F),
322
- cmyk: new RegExp("cmyk" + F),
323
- hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
324
- hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
325
- hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
326
- hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
327
- };
328
- function ve(r) {
329
- if (r = r.trim().toLowerCase(), r.length === 0)
330
- return !1;
331
- let t = !1;
332
- if (C[r])
333
- r = C[r], t = !0;
334
- else if (r === "transparent")
335
- return { r: 0, g: 0, b: 0, a: 0, format: "name" };
336
- let e = c.rgb.exec(r);
337
- return e ? { r: e[1], g: e[2], b: e[3] } : (e = c.rgba.exec(r), e ? { r: e[1], g: e[2], b: e[3], a: e[4] } : (e = c.hsl.exec(r), e ? { h: e[1], s: e[2], l: e[3] } : (e = c.hsla.exec(r), e ? { h: e[1], s: e[2], l: e[3], a: e[4] } : (e = c.hsv.exec(r), e ? { h: e[1], s: e[2], v: e[3] } : (e = c.hsva.exec(r), e ? { h: e[1], s: e[2], v: e[3], a: e[4] } : (e = c.cmyk.exec(r), e ? {
338
- c: e[1],
339
- m: e[2],
340
- y: e[3],
341
- k: e[4]
342
- } : (e = c.hex8.exec(r), e ? {
343
- r: g(e[1]),
344
- g: g(e[2]),
345
- b: g(e[3]),
346
- a: P(e[4]),
347
- format: t ? "name" : "hex8"
348
- } : (e = c.hex6.exec(r), e ? {
349
- r: g(e[1]),
350
- g: g(e[2]),
351
- b: g(e[3]),
352
- format: t ? "name" : "hex"
353
- } : (e = c.hex4.exec(r), e ? {
354
- r: g(e[1] + e[1]),
355
- g: g(e[2] + e[2]),
356
- b: g(e[3] + e[3]),
357
- a: P(e[4] + e[4]),
358
- format: t ? "name" : "hex8"
359
- } : (e = c.hex3.exec(r), e ? {
360
- r: g(e[1] + e[1]),
361
- g: g(e[2] + e[2]),
362
- b: g(e[3] + e[3]),
363
- format: t ? "name" : "hex"
364
- } : !1))))))))));
365
- }
366
- function l(r) {
367
- return typeof r == "number" ? !Number.isNaN(r) : c.CSS_UNIT.test(r);
368
- }
369
- var Me = Object.defineProperty, $e = (r, t, e) => t in r ? Me(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e, p = (r, t, e) => $e(r, typeof t != "symbol" ? t + "" : t, e);
370
- class h {
371
- constructor(t = "", e = {}) {
372
- if (p(this, "r"), p(this, "g"), p(this, "b"), p(this, "a"), p(this, "format"), p(this, "originalInput"), p(this, "isValid"), p(this, "gradientType"), p(this, "roundA"), t instanceof h)
373
- return t;
374
- typeof t == "number" && (t = pe(t)), this.originalInput = t;
375
- const a = ye(t);
376
- this.originalInput = t, this.r = a.r, this.g = a.g, this.b = a.b, this.a = a.a, this.roundA = Math.round(100 * this.a) / 100, this.format = e.format ?? a.format, this.gradientType = e.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = a.ok;
377
- }
378
- get ok() {
379
- return this.isValid;
380
- }
381
- isDark() {
382
- return this.getBrightness() < 128;
383
- }
384
- isLight() {
385
- return !this.isDark();
386
- }
387
- /**
388
- * Returns the perceived brightness of the color, from 0-255.
389
- */
390
- getBrightness() {
391
- const t = this.toRgb();
392
- return (t.r * 299 + t.g * 587 + t.b * 114) / 1e3;
393
- }
394
- /**
395
- * Returns the perceived luminance of a color, from 0-1.
396
- */
397
- getLuminance() {
398
- const t = this.toRgb();
399
- let e, a, n;
400
- const s = t.r / 255, i = t.g / 255, o = t.b / 255;
401
- return s <= 0.03928 ? e = s / 12.92 : e = Math.pow((s + 0.055) / 1.055, 2.4), i <= 0.03928 ? a = i / 12.92 : a = Math.pow((i + 0.055) / 1.055, 2.4), o <= 0.03928 ? n = o / 12.92 : n = Math.pow((o + 0.055) / 1.055, 2.4), 0.2126 * e + 0.7152 * a + 0.0722 * n;
402
- }
403
- /**
404
- * Returns the alpha value of a color, from 0-1.
405
- */
406
- getAlpha() {
407
- return this.a;
408
- }
409
- /**
410
- * Sets the alpha value on the current color.
411
- *
412
- * @param alpha - The new alpha value. The accepted range is 0-1.
413
- */
414
- setAlpha(t) {
415
- return this.a = L(t), this.roundA = Math.round(100 * this.a) / 100, this;
416
- }
417
- /**
418
- * Returns whether the color is monochrome.
419
- */
420
- isMonochrome() {
421
- const { s: t } = this.toHsl();
422
- return t === 0;
423
- }
424
- /**
425
- * Returns the object as a HSVA object.
426
- */
427
- toHsv() {
428
- const t = R(this.r, this.g, this.b);
429
- return { h: t.h * 360, s: t.s, v: t.v, a: this.a };
430
- }
431
- toHsv_() {
432
- const t = R(this.r, this.g, this.b);
433
- return { h: t.h, s: t.s, v: t.v, a: this.a };
434
- }
435
- /**
436
- * Returns the hsva values interpolated into a string with the following format:
437
- * "hsva(xxx, xxx, xxx, xx)".
438
- */
439
- toHsvString() {
440
- const t = R(this.r, this.g, this.b), e = Math.round(t.h * 360), a = Math.round(t.s * 100), n = Math.round(t.v * 100);
441
- return this.a === 1 ? `hsv(${e}, ${a}%, ${n}%)` : `hsva(${e}, ${a}%, ${n}%, ${this.roundA})`;
442
- }
443
- /**
444
- * Returns the object as a HSLA object.
445
- */
446
- toHsl() {
447
- const t = q(this.r, this.g, this.b);
448
- return { h: t.h * 360, s: t.s, l: t.l, a: this.a };
449
- }
450
- /**
451
- * Returns the hsla values interpolated into a string with the following format:
452
- * "hsla(xxx, xxx, xxx, xx)".
453
- */
454
- toHslString() {
455
- const t = q(this.r, this.g, this.b), e = Math.round(t.h * 360), a = Math.round(t.s * 100), n = Math.round(t.l * 100);
456
- return this.a === 1 ? `hsl(${e}, ${a}%, ${n}%)` : `hsla(${e}, ${a}%, ${n}%, ${this.roundA})`;
457
- }
458
- /**
459
- * Returns the hex value of the color.
460
- * @param allow3Char will shorten hex value to 3 char if possible
461
- */
462
- toHex(t = !1) {
463
- return T(this.r, this.g, this.b, t);
464
- }
465
- /**
466
- * Returns the hex value of the color -with a # prefixed.
467
- * @param allow3Char will shorten hex value to 3 char if possible
468
- */
469
- toHexString(t = !1) {
470
- return `#${this.toHex(t)}`;
471
- }
472
- /**
473
- * Returns the hex 8 value of the color.
474
- * @param allow4Char will shorten hex value to 4 char if possible
475
- */
476
- toHex8(t = !1) {
477
- return be(this.r, this.g, this.b, this.a, t);
478
- }
479
- /**
480
- * Returns the hex 8 value of the color -with a # prefixed.
481
- * @param allow4Char will shorten hex value to 4 char if possible
482
- */
483
- toHex8String(t = !1) {
484
- return `#${this.toHex8(t)}`;
485
- }
486
- /**
487
- * Returns the shorter hex value of the color depends on its alpha -with a # prefixed.
488
- * @param allowShortChar will shorten hex value to 3 or 4 char if possible
489
- */
490
- toHexShortString(t = !1) {
491
- return this.a === 1 ? this.toHexString(t) : this.toHex8String(t);
492
- }
493
- /**
494
- * Returns the object as a RGBA object.
495
- */
496
- toRgb() {
497
- return {
498
- r: Math.round(this.r),
499
- g: Math.round(this.g),
500
- b: Math.round(this.b),
501
- a: this.a
502
- };
503
- }
504
- toRgba() {
505
- return this.toRgb();
506
- }
507
- toRgbArray() {
508
- const t = this.toRgb();
509
- return [t.r, t.g, t.b];
510
- }
511
- toRgbArrayString() {
512
- const t = this.toRgb();
513
- return `${t.r},${t.g},${t.b}`;
514
- }
515
- /**
516
- * Returns the RGBA values interpolated into a string with the following format:
517
- * "RGBA(xxx, xxx, xxx, xx)".
518
- */
519
- toRgbString() {
520
- const t = Math.round(this.r), e = Math.round(this.g), a = Math.round(this.b);
521
- return this.a === 1 ? `rgb(${t}, ${e}, ${a})` : `rgba(${t}, ${e}, ${a}, ${this.roundA})`;
522
- }
523
- toRgbaString() {
524
- const t = Math.round(this.r), e = Math.round(this.g), a = Math.round(this.b);
525
- return `rgba(${t}, ${e}, ${a}, ${this.roundA})`;
526
- }
527
- /**
528
- * Returns the object as a RGBA object.
529
- */
530
- toPercentageRgb() {
531
- const t = (e) => `${Math.round(u(e, 255) * 100)}%`;
532
- return {
533
- r: t(this.r),
534
- g: t(this.g),
535
- b: t(this.b),
536
- a: this.a
537
- };
538
- }
539
- /**
540
- * Returns the RGBA relative values interpolated into a string
541
- */
542
- toPercentageRgbString() {
543
- const t = (e) => Math.round(u(e, 255) * 100);
544
- return this.a === 1 ? `rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)` : `rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`;
545
- }
546
- toCmyk() {
547
- return {
548
- ...O(this.r, this.g, this.b)
549
- };
550
- }
551
- toCmykString() {
552
- const { c: t, m: e, y: a, k: n } = O(this.r, this.g, this.b);
553
- return `cmyk(${t}, ${e}, ${a}, ${n})`;
554
- }
555
- /**
556
- * The 'real' name of the color -if there is one.
557
- */
558
- toName() {
559
- if (this.a === 0)
560
- return "transparent";
561
- if (this.a < 1)
562
- return !1;
563
- const t = `#${T(this.r, this.g, this.b, !1)}`;
564
- for (const [e, a] of Object.entries(C))
565
- if (t === a)
566
- return e;
567
- return !1;
568
- }
569
- toString(t) {
570
- const e = !!t;
571
- t = t ?? this.format;
572
- let a = !1;
573
- const n = this.a < 1 && this.a >= 0;
574
- return !e && n && (t.startsWith("hex") || t === "name") ? t === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (t === "rgb" && (a = this.toRgbString()), t === "prgb" && (a = this.toPercentageRgbString()), (t === "hex" || t === "hex6") && (a = this.toHexString()), t === "hex3" && (a = this.toHexString(!0)), t === "hex4" && (a = this.toHex8String(!0)), t === "hex8" && (a = this.toHex8String()), t === "name" && (a = this.toName()), t === "hsl" && (a = this.toHslString()), t === "hsv" && (a = this.toHsvString()), t === "cmyk" && (a = this.toCmykString()), a || this.toHexString());
575
- }
576
- toNumber() {
577
- return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
578
- }
579
- clone() {
580
- return new h(this.toString());
581
- }
582
- /**
583
- * Lighten the color a given amount. Providing 100 will always return white.
584
- * @param amount - valid between 1-100
585
- */
586
- lighten(t = 10) {
587
- const e = this.toHsl();
588
- return e.l += t / 100, e.l = A(e.l), new h(e);
589
- }
590
- /**
591
- * Brighten the color a given amount, from 0 to 100.
592
- * @param amount - valid between 1-100
593
- */
594
- brighten(t = 10) {
595
- const e = this.toRgb();
596
- return e.r = Math.max(
597
- 0,
598
- Math.min(255, e.r - Math.round(255 * -(t / 100)))
599
- ), e.g = Math.max(
600
- 0,
601
- Math.min(255, e.g - Math.round(255 * -(t / 100)))
602
- ), e.b = Math.max(
603
- 0,
604
- Math.min(255, e.b - Math.round(255 * -(t / 100)))
605
- ), new h(e);
606
- }
607
- /**
608
- * Darken the color a given amount, from 0 to 100.
609
- * Providing 100 will always return black.
610
- * @param amount - valid between 1-100
611
- */
612
- darken(t = 10) {
613
- const e = this.toHsl();
614
- return e.l -= t / 100, e.l = A(e.l), new h(e);
615
- }
616
- /**
617
- * Mix the color with pure white, from 0 to 100.
618
- * Providing 0 will do nothing, providing 100 will always return white.
619
- * @param amount - valid between 1-100
620
- */
621
- tint(t = 10) {
622
- return this.mix("white", t);
623
- }
624
- /**
625
- * Mix the color with pure black, from 0 to 100.
626
- * Providing 0 will do nothing, providing 100 will always return black.
627
- * @param amount - valid between 1-100
628
- */
629
- shade(t = 10) {
630
- return this.mix("black", t);
631
- }
632
- /**
633
- * Desaturate the color a given amount, from 0 to 100.
634
- * Providing 100 will is the same as calling greyscale
635
- * @param amount - valid between 1-100
636
- */
637
- desaturate(t = 10) {
638
- const e = this.toHsl();
639
- return e.s -= t / 100, e.s = A(e.s), new h(e);
640
- }
641
- /**
642
- * Saturate the color a given amount, from 0 to 100.
643
- * @param amount - valid between 1-100
644
- */
645
- saturate(t = 10) {
646
- const e = this.toHsl();
647
- return e.s += t / 100, e.s = A(e.s), new h(e);
648
- }
649
- /**
650
- * Completely desaturates a color into greyscale.
651
- * Same as calling `desaturate(100)`
652
- */
653
- greyscale() {
654
- return this.desaturate(100);
655
- }
656
- /**
657
- * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
658
- * Values outside of this range will be wrapped into this range.
659
- */
660
- spin(t) {
661
- const e = this.toHsl(), a = (e.h + t) % 360;
662
- return e.h = a < 0 ? 360 + a : a, new h(e);
663
- }
664
- /**
665
- * Mix the current color a given amount with another color, from 0 to 100.
666
- * 0 means no mixing (return current color).
667
- */
668
- mix(t, e = 50) {
669
- const a = this.toRgb(), n = new h(t).toRgb(), s = e / 100, i = {
670
- r: (n.r - a.r) * s + a.r,
671
- g: (n.g - a.g) * s + a.g,
672
- b: (n.b - a.b) * s + a.b,
673
- a: (n.a - a.a) * s + a.a
674
- };
675
- return new h(i);
676
- }
677
- analogous(t = 6, e = 30) {
678
- const a = this.toHsl(), n = 360 / e, s = [this];
679
- for (a.h = (a.h - (n * t >> 1) + 720) % 360; --t; )
680
- a.h = (a.h + n) % 360, s.push(new h(a));
681
- return s;
682
- }
683
- /**
684
- * taken from https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js
685
- */
686
- complement() {
687
- const t = this.toHsl();
688
- return t.h = (t.h + 180) % 360, new h(t);
689
- }
690
- monochromatic(t = 6) {
691
- const e = this.toHsv(), { h: a } = e, { s: n } = e;
692
- let { v: s } = e;
693
- const i = [], o = 1 / t;
694
- for (; t--; )
695
- i.push(new h({ h: a, s: n, v: s })), s = (s + o) % 1;
696
- return i;
697
- }
698
- splitcomplement() {
699
- const t = this.toHsl(), { h: e } = t;
700
- return [
701
- this,
702
- new h({ h: (e + 72) % 360, s: t.s, l: t.l }),
703
- new h({ h: (e + 216) % 360, s: t.s, l: t.l })
704
- ];
705
- }
706
- /**
707
- * Compute how the color would appear on a background
708
- */
709
- onBackground(t) {
710
- const e = this.toRgb(), a = new h(t).toRgb(), n = e.a + a.a * (1 - e.a);
711
- return new h({
712
- r: (e.r * e.a + a.r * a.a * (1 - e.a)) / n,
713
- g: (e.g * e.a + a.g * a.a * (1 - e.a)) / n,
714
- b: (e.b * e.a + a.b * a.a * (1 - e.a)) / n,
715
- a: n
716
- });
717
- }
718
- /**
719
- * Alias for `polyad(3)`
720
- */
721
- triad() {
722
- return this.polyad(3);
723
- }
724
- /**
725
- * Alias for `polyad(4)`
726
- */
727
- tetrad() {
728
- return this.polyad(4);
729
- }
730
- /**
731
- * Get polyad colors, like (for 1, 2, 3, 4, 5, 6, 7, 8, etc...)
732
- * monad, dyad, triad, tetrad, pentad, hexad, heptad, octad, etc...
733
- */
734
- polyad(t) {
735
- const e = this.toHsl(), { h: a } = e, n = [this], s = 360 / t;
736
- for (let i = 1; i < t; i++)
737
- n.push(
738
- new h({ h: (a + i * s) % 360, s: e.s, l: e.l })
739
- );
740
- return n;
741
- }
742
- /**
743
- * compare color vs current color
744
- */
745
- equals(t) {
746
- const e = new h(t);
747
- return this.format === "cmyk" || e.format === "cmyk" ? this.toCmykString() === e.toCmykString() : this.toRgbString() === e.toRgbString();
748
- }
749
- }
750
- const k = 10, G = {
751
- name: { zh: "浪漫红", en: "red" },
752
- value: "#F53F3F"
753
- }, U = {
754
- name: { zh: "晚秋红", en: "orangered" },
755
- value: "#FF702E"
756
- }, J = {
757
- name: { zh: "活力橙", en: "orange" },
758
- value: "#FFA500"
759
- }, K = {
760
- name: { zh: "黄昏", en: "gold" },
761
- value: "#FFBD14"
762
- }, Q = {
763
- name: { zh: "柠檬黄", en: "yellow" },
764
- value: "#FFE014"
765
- }, X = {
766
- name: { zh: "新生绿", en: "lime" },
767
- value: "#A1E619"
768
- }, Y = {
769
- name: { zh: "仙野绿", en: "green" },
770
- value: "#00B82B"
771
- }, Z = {
772
- name: { zh: "碧涛青", en: "cyan" },
773
- value: "#0BD0D0"
774
- }, _ = {
775
- name: { zh: "海蔚蓝", en: "blue" },
776
- value: "#2E8FFF"
777
- }, ee = {
778
- name: { zh: "极致蓝", en: "pqbblue" },
779
- value: "#1A5EFF"
780
- }, te = {
781
- name: { zh: "暗夜紫", en: "purple" },
782
- value: "#7126D9"
783
- }, re = {
784
- name: { zh: "青春紫", en: "pinkpurple" },
785
- value: "#D91AD9"
786
- }, ae = {
787
- name: { zh: "品红", en: "magenta" },
788
- value: "#FF299F"
789
- }, w = {
790
- name: { zh: "中性灰", en: "gray" },
791
- value: "#6B6C6D"
792
- }, z = [
793
- G,
794
- U,
795
- J,
796
- K,
797
- Q,
798
- X,
799
- Y,
800
- Z,
801
- _,
802
- ee,
803
- te,
804
- re,
805
- ae
806
- ];
807
- var W, I;
808
- const ne = {
809
- key: ((W = w.name) == null ? void 0 : W.en) ?? ((I = w.name) == null ? void 0 : I.zh) ?? w.name,
810
- name: w.name,
811
- primary: w.value,
812
- light: [
813
- new h("#F7F8F9"),
814
- new h("#F2F3F4"),
815
- new h("#E5E6E7"),
816
- new h("#C9CACB"),
817
- new h("#A9ABAC"),
818
- new h("#868788"),
819
- new h(w.value),
820
- new h("#4D4E4F"),
821
- new h("#28292A"),
822
- new h("#1E1F20")
823
- ],
824
- dark: [
825
- new h("#121213"),
826
- new h("#1C1C1D"),
827
- new h("#404142"),
828
- new h("#5E5F60"),
829
- new h("#797A7B"),
830
- new h("#9C9E9F"),
831
- new h("#BCBDBE"),
832
- new h("#D8D9DB"),
833
- new h("#E4E6E8"),
834
- new h("#E8EBEE")
835
- ]
836
- }, xe = z.map((r, t, e) => {
837
- const a = r.name, n = (a == null ? void 0 : a.en) ?? (a == null ? void 0 : a.zh) ?? a, s = r.value;
838
- return {
839
- key: n,
840
- name: a,
841
- primary: s,
842
- light: ie({ color: s, length: k }),
843
- dark: he({ color: s, length: k })
844
- };
845
- }).concat([ne]);
846
- function D(r = {}) {
847
- const { length: t, color: e, level: a } = r, n = (t ?? k) / 2 + 1, s = a ?? n;
848
- let i = new h(e);
849
- const o = i.toHsv(), f = o.h, d = o.s, m = o.v, M = f === 0 && d === 0, B = s < n, $ = Math.abs(n - s), oe = 1, N = 0.1;
850
- let v = d;
851
- v > N && (B ? v = d - (d - N) / (n - 1) * $ : v = d + (oe - d) / (n - 1) * $), M && (v = d);
852
- const ue = M ? 0.97 : 1, j = 0.1;
853
- let x = m;
854
- return x > j && (B ? x = m + (ue - m) / (n - 1) * $ : x = m - (m - j) / (n - 1) * $), i = new h({
855
- h: f,
856
- s: v,
857
- v: x
858
- }), r.dark && (i = i.darken(r.amount ?? 10)), i;
859
- }
860
- function se(r = {}) {
861
- return D({ ...r, dark: !0 });
862
- }
863
- function ie(r = {}) {
864
- const { length: t } = r;
865
- return Array.from(new Array(t ?? k), (e, a) => {
866
- const n = a + 1;
867
- return D({ ...r, level: n });
868
- });
869
- }
870
- function he(r = {}) {
871
- const { length: t } = r;
872
- return Array.from(new Array(t ?? k), (e, a) => {
873
- const n = a + 1;
874
- return se({
875
- ...r,
876
- level: k - n + 1
877
- });
878
- });
879
- }
880
- const Se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
881
- __proto__: null,
882
- LENGTH: k,
883
- blue: _,
884
- colorPresets: xe,
885
- colors: z,
886
- cyan: Z,
887
- default: z,
888
- generate: ie,
889
- generateDark: he,
890
- gold: K,
891
- gray: w,
892
- grayPresets: ne,
893
- green: Y,
894
- lime: X,
895
- magenta: ae,
896
- orange: J,
897
- orangered: U,
898
- palette: D,
899
- paletteDark: se,
900
- pinkpurple: re,
901
- pqbblue: ee,
902
- purple: te,
903
- red: G,
904
- yellow: Q
905
- }, Symbol.toStringTag, { value: "Module" }));
906
- export {
907
- ge as A,
908
- O as C,
909
- T as H,
910
- ye as N,
911
- Se as R,
912
- de as S,
913
- q as T,
914
- be as W,
915
- pe as a,
916
- g as b,
917
- h as c,
918
- V as d,
919
- C as e,
920
- P as j,
921
- ce as k,
922
- R as l,
923
- l as n,
924
- Ae as p,
925
- ve as w,
926
- me as y
927
- };