@unicom-cloud/ui 0.8.100 → 0.8.102

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 (301) hide show
  1. package/Badge.js +7 -54
  2. package/Copy.js +5 -4
  3. package/Details.js +13 -2
  4. package/Divider.js +3 -2
  5. package/Flex.js +14 -4
  6. package/LiquidFill.js +5 -4
  7. package/List.js +1 -1
  8. package/Loading.js +16 -3
  9. package/Marquee.js +5 -4
  10. package/QrCode.js +5 -4
  11. package/Space.js +3 -3
  12. package/Splitter.js +4 -3
  13. package/SuspenseFallbackTest.js +2 -4
  14. package/Tooltip.js +3 -4
  15. package/Tour.js +5 -4
  16. package/alert/index.js +60 -62
  17. package/anchor/Anchor.js +12 -12
  18. package/anchor/util.js +10 -10
  19. package/back-top/index.js +33 -34
  20. package/badge/index.js +109 -162
  21. package/calendar/index.js +85 -84
  22. package/card/index.js +63 -43
  23. package/color-picker/InputHex.js +3 -4
  24. package/color-picker/InputRgb.js +7 -8
  25. package/color-picker/Palette.js +3 -4
  26. package/color-picker/Panel.js +3 -4
  27. package/color-picker/colors.js +5 -5
  28. package/color-picker/hooks/useColorPicker.js +3 -4
  29. package/color-picker/utils.js +14 -15
  30. package/components/common/development/index.js +44 -29
  31. package/components/common/empty/index.js +35 -23
  32. package/components/common/flex/index.js +64 -0
  33. package/components/common/flex/interface.js +9 -0
  34. package/components/common/higher-order/with-speech-synthesis/index.js +79 -55
  35. package/components/common/space/index.js +71 -91
  36. package/components/common/suspense-fallback-test/index.js +16 -0
  37. package/components/common/utils/PqbCSSTransition.js +1 -1
  38. package/components/common/utils/constant.js +6 -3
  39. package/components/common/utils/reactDOM.js +6 -4
  40. package/components/common/utils/{scrollIntoView.js → scrollIntoViewIfNeeded.js} +1 -1
  41. package/components/common/utils/setPrimaryColor.js +18 -18
  42. package/components/common/utils/setTheme.js +8 -9
  43. package/components/common/utils/toArray.js +12 -0
  44. package/copy/index.js +3 -2
  45. package/details/index.js +102 -62
  46. package/dist/scroll-into-view-if-needed/compute/index.js +126 -0
  47. package/dist/scroll-into-view-if-needed/smooth/index.js +70 -0
  48. package/dist/scroll-into-view-if-needed/src/index.js +19 -19
  49. package/divider/index.js +27 -21
  50. package/empty/index.js +13 -13
  51. package/flex/index.js +43 -55
  52. package/flex/interface.js +1 -34
  53. package/form/FormItem.js +69 -65
  54. package/form/context.js +6 -7
  55. package/grid/Col-.js +86 -0
  56. package/grid/Col.js +156 -73
  57. package/grid/Grid.js +71 -67
  58. package/grid/Row.js +3 -3
  59. package/grid/index.js +13 -13
  60. package/icon/interface.js +1 -0
  61. package/icon-hover/interface.js +1 -0
  62. package/index.js +641 -663
  63. package/input/Textarea.js +1 -1
  64. package/input/autoSizeTextAreaHeight.js +7 -7
  65. package/liquid-fill/index.js +5 -4
  66. package/list/index.js +1 -1
  67. package/loading/index.js +72 -53
  68. package/loading/interface.js +1 -0
  69. package/marquee/index.js +5 -4
  70. package/menu/Item.js +9 -9
  71. package/modal/Modal.js +73 -74
  72. package/package.json +1 -1
  73. package/portal/interface.js +1 -0
  74. package/qr-code/index.js +5 -4
  75. package/segmented/index.js +47 -47
  76. package/space/index.js +41 -35
  77. package/speech-synthesis/interface.js +1 -0
  78. package/splitter/SplitBar.js +81 -79
  79. package/splitter/Splitter.js +92 -104
  80. package/splitter/hooks/useItems.js +1 -1
  81. package/splitter/hooks/useResizable.js +9 -18
  82. package/splitter/hooks/useResize.js +10 -10
  83. package/splitter/hooks/useSizes.js +28 -28
  84. package/splitter/index.js +5 -4
  85. package/statistic/index.js +10 -10
  86. package/style.css +1 -1
  87. package/suspense-fallback-test/index.js +2 -11
  88. package/suspense-fallback-test/interface.js +1 -0
  89. package/table/Table.js +376 -377
  90. package/table/hook/useThResizable.js +5 -4
  91. package/table/th-resizable/index.js +12 -11
  92. package/time-picker/util.js +8 -8
  93. package/tooltip/index.js +1 -2
  94. package/tour/index.js +5 -4
  95. package/tree/NodeList.js +1 -1
  96. package/trigger/index.js +67 -70
  97. package/types/common/development/index.d.ts +7 -1
  98. package/types/common/development/interface.d.ts +22 -0
  99. package/types/common/empty/index.d.ts +2 -1
  100. package/types/common/flex/index.d.ts +14 -0
  101. package/types/common/flex/interface.d.ts +62 -0
  102. package/types/common/higher-order/with-speech-synthesis/index.d.ts +6 -1
  103. package/types/common/higher-order/with-speech-synthesis/interface.d.ts +13 -0
  104. package/types/common/space/index.d.ts +4 -4
  105. package/types/common/space/interface.d.ts +10 -18
  106. package/types/common/suspense-fallback-test/index.d.ts +7 -0
  107. package/types/common/suspense-fallback-test/interface.d.ts +1 -0
  108. package/types/common/utils/PqbCSSTransition.d.ts +1 -1
  109. package/types/common/utils/constant.d.ts +1 -0
  110. package/types/common/utils/scrollIntoViewIfNeeded.d.ts +4 -0
  111. package/types/common/utils/toArray.d.ts +13 -0
  112. package/types/common/utils/tree.d.ts +1 -0
  113. package/types/common/utils/tween.d.ts +1 -0
  114. package/types/pc/alert/index.d.ts +2 -1
  115. package/types/pc/alert/interface.d.ts +7 -1
  116. package/types/pc/anchor/util.d.ts +1 -1
  117. package/types/pc/badge/Count.d.ts +1 -1
  118. package/types/pc/badge/interface.d.ts +2 -0
  119. package/types/pc/breadcrumb/Item.d.ts +1 -1
  120. package/types/pc/calendar/Month.d.ts +1 -1
  121. package/types/pc/calendar/WeekList.d.ts +1 -1
  122. package/types/pc/calendar/Year.d.ts +1 -1
  123. package/types/pc/calendar/header/Panel.d.ts +1 -1
  124. package/types/pc/calendar/header/index.d.ts +1 -1
  125. package/types/pc/calendar/index.d.ts +1 -1
  126. package/types/pc/calendar/interface.d.ts +2 -1
  127. package/types/pc/card/interface.d.ts +8 -0
  128. package/types/pc/cascader/interface.d.ts +1 -1
  129. package/types/pc/cascader/panel/List.d.ts +1 -1
  130. package/types/pc/cascader/panel/Option.d.ts +1 -1
  131. package/types/pc/cascader/panel/Search.d.ts +1 -1
  132. package/types/pc/checkbox/Group.d.ts +2 -2
  133. package/types/pc/checkbox/GroupBlock.d.ts +1 -1
  134. package/types/pc/checkbox/IconCheck.d.ts +1 -1
  135. package/types/pc/color-picker/InputRgb.d.ts +1 -1
  136. package/types/pc/color-picker/Palette.d.ts +1 -1
  137. package/types/pc/color-picker/hooks/useColorPicker.d.ts +7 -2
  138. package/types/pc/color-picker/utils.d.ts +6 -1
  139. package/types/pc/config-provider/ConfigProvider.d.ts +1 -1
  140. package/types/pc/config-provider/interface.d.ts +4 -0
  141. package/types/pc/copy/index.d.ts +1 -1
  142. package/types/pc/date-picker/panel/Body.d.ts +1 -1
  143. package/types/pc/date-picker/panel/Footer.d.ts +1 -1
  144. package/types/pc/date-picker/panel/Header.d.ts +1 -1
  145. package/types/pc/date-picker/panel/WeekList.d.ts +1 -1
  146. package/types/pc/date-picker/panel/date/index.d.ts +1 -1
  147. package/types/pc/date-picker/panel/month/index.d.ts +1 -1
  148. package/types/pc/date-picker/panel/quarter/index.d.ts +1 -1
  149. package/types/pc/date-picker/panel/range/index.d.ts +1 -1
  150. package/types/pc/date-picker/panel/week/index.d.ts +1 -1
  151. package/types/pc/date-picker/panel/year/index.d.ts +1 -1
  152. package/types/pc/descriptions/index.d.ts +1 -1
  153. package/types/pc/details/index.d.ts +3 -2
  154. package/types/pc/details/interface.d.ts +16 -0
  155. package/types/pc/development/index.d.ts +2 -1
  156. package/types/pc/development/interface.d.ts +15 -0
  157. package/types/pc/divider/index.d.ts +7 -2
  158. package/types/pc/draggable/Item.d.ts +1 -1
  159. package/types/pc/draggable/index.d.ts +1 -1
  160. package/types/pc/flex/index.d.ts +4 -4
  161. package/types/pc/flex/interface.d.ts +8 -53
  162. package/types/pc/form/Control.d.ts +1 -1
  163. package/types/pc/form/FormItem.d.ts +1 -1
  164. package/types/pc/form/FormList.d.ts +1 -1
  165. package/types/pc/form/IconSymbol.d.ts +1 -1
  166. package/types/pc/grid/Col-.d.ts +4 -0
  167. package/types/pc/grid/Col.d.ts +3 -2
  168. package/types/pc/grid/Grid.d.ts +2 -2
  169. package/types/pc/grid/Item.d.ts +3 -3
  170. package/types/pc/grid/Row.d.ts +2 -2
  171. package/types/pc/grid/hook/useResponsiveState.d.ts +2 -2
  172. package/types/pc/grid/interface.d.ts +13 -7
  173. package/types/pc/icon/addFromIconFontCn.d.ts +1 -7
  174. package/types/pc/icon/index.d.ts +2 -7
  175. package/types/pc/icon/interface.d.ts +13 -0
  176. package/types/pc/icon-hover/index.d.ts +2 -8
  177. package/types/pc/icon-hover/interface.d.ts +8 -0
  178. package/types/pc/image/ImageFooter.d.ts +1 -1
  179. package/types/pc/image/ImagePreviewArrow.d.ts +1 -1
  180. package/types/pc/image/TriggerForToolbar.d.ts +1 -1
  181. package/types/pc/index.d.ts +60 -51
  182. package/types/pc/loading/index.d.ts +4 -3
  183. package/types/pc/loading/interface.d.ts +6 -0
  184. package/types/pc/menu/Indent.d.ts +1 -1
  185. package/types/pc/menu/OverflowWrap.d.ts +1 -1
  186. package/types/pc/menu/sub-menu/Inline.d.ts +1 -1
  187. package/types/pc/menu/sub-menu/Pop.d.ts +1 -1
  188. package/types/pc/overflow-ellipsis/OverflowItem.d.ts +1 -1
  189. package/types/pc/overflow-ellipsis/index.d.ts +1 -1
  190. package/types/pc/pagination/PageItem.d.ts +3 -3
  191. package/types/pc/pagination/PageJumper.d.ts +1 -1
  192. package/types/pc/pagination/PageOption.d.ts +1 -1
  193. package/types/pc/portal/Portal.d.ts +2 -6
  194. package/types/pc/portal/index.d.ts +2 -9
  195. package/types/pc/portal/interface.d.ts +14 -0
  196. package/types/pc/progress/CircleProgress.d.ts +1 -1
  197. package/types/pc/progress/LineProgess.d.ts +1 -1
  198. package/types/pc/progress/StepProgress.d.ts +1 -1
  199. package/types/pc/radio/Group.d.ts +2 -2
  200. package/types/pc/radio/GroupBlock.d.ts +1 -1
  201. package/types/pc/radio/Radio.d.ts +1 -1
  202. package/types/pc/resize-box/ResizeTrigger.d.ts +1 -1
  203. package/types/pc/result/403.d.ts +1 -1
  204. package/types/pc/result/404.d.ts +1 -1
  205. package/types/pc/result/500.d.ts +1 -1
  206. package/types/pc/segmented/interface.d.ts +6 -6
  207. package/types/pc/skeleton/Image.d.ts +1 -1
  208. package/types/pc/skeleton/Text.d.ts +2 -1
  209. package/types/pc/slider/Button.d.ts +1 -1
  210. package/types/pc/slider/Input.d.ts +1 -1
  211. package/types/pc/slider/Tick.d.ts +1 -1
  212. package/types/pc/space/index.d.ts +6 -5
  213. package/types/pc/speech-synthesis/index.d.ts +3 -1
  214. package/types/pc/speech-synthesis/interface.d.ts +7 -0
  215. package/types/pc/spin/DotLoading.d.ts +1 -1
  216. package/types/pc/splitter/SplitBar.d.ts +0 -1
  217. package/types/pc/splitter/hooks/useResizable.d.ts +0 -1
  218. package/types/pc/splitter/hooks/useResize.d.ts +1 -2
  219. package/types/pc/splitter/index.d.ts +5 -4
  220. package/types/pc/splitter/interface.d.ts +16 -24
  221. package/types/pc/suspense-fallback-test/index.d.ts +2 -3
  222. package/types/pc/suspense-fallback-test/interface.d.ts +2 -0
  223. package/types/pc/table/ColGroup.d.ts +1 -1
  224. package/types/pc/table/summary/Cell.d.ts +1 -1
  225. package/types/pc/table/summary/Row.d.ts +1 -1
  226. package/types/pc/table/tbody/Td.d.ts +1 -1
  227. package/types/pc/table/tbody/index.d.ts +1 -1
  228. package/types/pc/table/tfoot/index.d.ts +1 -1
  229. package/types/pc/table/th-resizable/index.d.ts +1 -1
  230. package/types/pc/table/thead/Column.d.ts +1 -1
  231. package/types/pc/table/thead/index.d.ts +1 -1
  232. package/types/pc/tabs/TabContent.d.ts +1 -1
  233. package/types/pc/tabs/tab-header/DropdownIcon.d.ts +1 -1
  234. package/types/pc/tabs/tab-header/TabInk.d.ts +1 -1
  235. package/types/pc/tabs/tab-header/TabNavIcon.d.ts +1 -1
  236. package/types/pc/time-picker/Picker.d.ts +1 -1
  237. package/types/pc/time-picker/RangePicker.d.ts +1 -1
  238. package/types/pc/time-picker/TimeColumn.d.ts +1 -1
  239. package/types/pc/time-picker/TimePicker.d.ts +1 -1
  240. package/types/pc/time-picker/index.d.ts +1 -1
  241. package/types/pc/tour/index.d.ts +1 -1
  242. package/types/pc/transfer/Item.d.ts +1 -1
  243. package/types/pc/transfer/List.d.ts +1 -1
  244. package/types/pc/tree/Animation.d.ts +1 -1
  245. package/types/pc/typography/Operations.d.ts +1 -1
  246. package/types/pc/upload/interface.d.ts +1 -0
  247. package/types/pc/upload/list/index.d.ts +1 -1
  248. package/types/pc/utils/constant.d.ts +1 -2
  249. package/types/pc/utils/dayjs.d.ts +2 -1
  250. package/types/pc/utils/index.d.ts +2 -5
  251. package/types/pc/utils/scrollIntoViewIfNeeded.d.ts +3 -0
  252. package/types/pc/utils/toArray.d.ts +1 -5
  253. package/types/pc/utils/tree.d.ts +2 -1
  254. package/types/pc/utils/tween.d.ts +1 -1
  255. package/types/pc/verification-code/VerificationCode.d.ts +1 -1
  256. package/types/pc/virtual-list/VirtualList.d.ts +2 -38
  257. package/types/pc/virtual-list/index.d.ts +2 -1
  258. package/types/pc/virtual-list/interface.d.ts +56 -0
  259. package/types/pc/watermark/Watermark.d.ts +1 -1
  260. package/typography/Ellipsis.js +5 -4
  261. package/typography/Operations.js +5 -4
  262. package/upload/request.js +12 -13
  263. package/upload/request_.js +2 -3
  264. package/utils/constant.js +5 -5
  265. package/utils/dayjs.js +13 -12
  266. package/utils/index.js +261 -284
  267. package/utils/scrollIntoViewIfNeeded.js +12 -0
  268. package/utils/toArray.js +3 -10
  269. package/utils/tree.js +11 -9
  270. package/utils/tween.js +5 -5
  271. package/version/index.js +1 -1
  272. package/virtual-list/interface.js +1 -0
  273. package/components/common/space/toArray.js +0 -11
  274. package/components/common/utils/convertToDurationBasedOnTimeUnits.js +0 -6
  275. package/dist/compute-scroll-into-view/src/index.js +0 -126
  276. package/dist/tinycolor/chunk/BOzCVdr0.js +0 -182
  277. package/dist/tinycolor/customize/index.js +0 -12
  278. package/dist/tinycolor/src/conversion.js +0 -143
  279. package/dist/tinycolor/src/css-color-names.js +0 -153
  280. package/dist/tinycolor/src/format-input.js +0 -77
  281. package/dist/tinycolor/src/index.js +0 -388
  282. package/dist/tinycolor/src/util.js +0 -32
  283. package/flex/utils.js +0 -13
  284. package/loading/style/index.module.less.js +0 -4
  285. package/types/common/space/toArray.d.ts +0 -3
  286. package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +0 -3
  287. package/types/common/utils/scrollIntoView.d.ts +0 -4
  288. package/types/common/utils/tinycolor.d.ts +0 -1
  289. package/types/pc/flex/utils.d.ts +0 -9
  290. package/types/pc/suspense-fallback-test/style/index.d.ts +0 -1
  291. package/types/pc/utils/color.d.ts +0 -1
  292. package/types/pc/utils/computeScrollIntoView.d.ts +0 -1
  293. package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +0 -3
  294. package/types/pc/utils/scrollIntoView.d.ts +0 -3
  295. package/types/pc/utils/tinycolor.d.ts +0 -1
  296. package/utils/color.js +0 -4
  297. package/utils/computeScrollIntoView.js +0 -6
  298. package/utils/convertToDurationBasedOnTimeUnits.js +0 -6
  299. package/utils/scrollIntoView.js +0 -6
  300. package/utils/tinycolor.js +0 -29
  301. /package/{suspense-fallback-test/style/index.less.js → development/interface.js} +0 -0
package/anchor/util.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { Tween as u } from "../dist/tween/src/tween.js";
2
- import { quartOut as c } from "../dist/tween/src/easing.js";
2
+ import c from "../dist/tween/src/easing.js";
3
3
  import i from "lodash/isString";
4
4
  import { isWindow as l } from "../components/common/utils/is.js";
5
- function s(o, n) {
5
+ function d(o, n) {
6
6
  const r = i(n) && n[0] === "#" ? `[id='${n.replace("#", "")}']` : n;
7
7
  try {
8
8
  return o.querySelector(r);
@@ -10,7 +10,7 @@ function s(o, n) {
10
10
  return console.error(t), null;
11
11
  }
12
12
  }
13
- function w(o, n, r) {
13
+ function a(o, n, r) {
14
14
  new u({
15
15
  from: {
16
16
  scrollTop: o.scrollTop
@@ -18,7 +18,7 @@ function w(o, n, r) {
18
18
  to: {
19
19
  scrollTop: n
20
20
  },
21
- easing: c,
21
+ easing: c.quartOut,
22
22
  duration: 300,
23
23
  onUpdate: (e) => {
24
24
  o.scrollTop = e.scrollTop;
@@ -29,23 +29,23 @@ function w(o, n, r) {
29
29
  }).start();
30
30
  }
31
31
  function g(o) {
32
- return i(o) ? s(document, o) : o || window;
32
+ return i(o) ? d(document, o) : o || window;
33
33
  }
34
34
  function S(o) {
35
35
  return l(o) ? document.documentElement || document.body : o;
36
36
  }
37
- function d(o) {
37
+ function s(o) {
38
38
  if (o == null)
39
39
  return null;
40
40
  if (o.tagName === "BODY")
41
41
  return o.ownerDocument.documentElement;
42
42
  const n = window.getComputedStyle(o).overflowY;
43
- return n !== "visible" && n !== "hidden" && o.scrollHeight > o.clientHeight ? o : d(o.parentElement);
43
+ return n !== "visible" && n !== "hidden" && o.scrollHeight > o.clientHeight ? o : s(o.parentElement);
44
44
  }
45
45
  export {
46
- s as findNode,
46
+ d as findNode,
47
47
  g as getContainer,
48
48
  S as getContainerElement,
49
- d as getScrollParent,
50
- w as slide
49
+ s as getScrollParent,
50
+ a as slide
51
51
  };
package/back-top/index.js CHANGED
@@ -1,41 +1,40 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import C from "@unicom-cloud/icons/IconUiToTop";
3
3
  import { Tween as v } from "../dist/tween/src/tween.js";
4
- import { quartOut as k } from "../dist/tween/src/easing.js";
5
- import x, { forwardRef as y, useRef as B, useContext as E, useState as N, useEffect as H } from "react";
4
+ import x from "../dist/tween/src/easing.js";
5
+ import k, { forwardRef as y, useContext as B, useState as E, useEffect as N } from "react";
6
6
  import "../config-provider/ConfigProvider.js";
7
- import P from "../components/common/hooks/useKeyboardEvent.js";
8
- import R from "../components/common/hooks/useMergeProps.js";
9
- import { PqbCSSTransition as S } from "../components/common/utils/PqbCSSTransition.js";
10
- import q from "@unicom-cloud/utils/class-name";
11
- import { on as $, off as D } from "../components/common/utils/dom.js";
12
- import { pickDataAttributes as I } from "../components/common/utils/pick.js";
13
- import { throttleByRaf as K } from "../components/common/utils/throttleByRaf.js";
14
- import O from "../config-provider/context.js";
15
- function U(p, i) {
16
- i ||= B();
7
+ import H from "../components/common/hooks/useKeyboardEvent.js";
8
+ import P from "../components/common/hooks/useMergeProps.js";
9
+ import { PqbCSSTransition as R } from "../components/common/utils/PqbCSSTransition.js";
10
+ import S from "@unicom-cloud/utils/class-name";
11
+ import { on as $, off as q } from "../components/common/utils/dom.js";
12
+ import { pickDataAttributes as D } from "../components/common/utils/pick.js";
13
+ import { throttleByRaf as I } from "../components/common/utils/throttleByRaf.js";
14
+ import K from "../config-provider/context.js";
15
+ function O(m, p) {
17
16
  const f = {
18
17
  visibleHeight: 400,
19
18
  tween: !0,
20
- easing: k,
19
+ easing: x.quartOut,
21
20
  duration: 400,
22
21
  target: () => window
23
- }, { getPrefixCls: u, componentConfig: d, rtl: g } = E(O), T = P(), o = R(
24
- p,
22
+ }, { getPrefixCls: u, componentConfig: d, rtl: g } = B(K), T = H(), o = P(
23
+ m,
25
24
  f,
26
25
  d?.BackTop
27
- ), s = u?.("backtop"), [b, w] = N(!1), l = (e) => e === window ? document.documentElement : e;
28
- H(() => {
29
- const e = o.target?.(), t = K(() => {
30
- const n = o.visibleHeight, a = l(e).scrollTop;
31
- w(a >= n);
26
+ ), s = u?.("backtop"), [b, w] = E(!1), i = (e) => e === window ? document.documentElement : e;
27
+ N(() => {
28
+ const e = o.target?.(), t = I(() => {
29
+ const n = o.visibleHeight, c = i(e).scrollTop;
30
+ w(c >= n);
32
31
  });
33
32
  return $(e, "scroll", t), t(), () => {
34
- t.cancel?.(), D(e, "scroll", t);
33
+ t.cancel?.(), q(e, "scroll", t);
35
34
  };
36
35
  }, [o.target, o.visibleHeight]);
37
- const c = () => {
38
- const e = o.target?.(), t = l(e), n = t.scrollTop;
36
+ const l = () => {
37
+ const e = o.target?.(), t = i(e), n = t.scrollTop;
39
38
  window.getComputedStyle(t)?.scrollBehavior === "smooth" || o.tween === !1 ? t.scrollTo(0, 0) : new v({
40
39
  from: { scrollTop: n },
41
40
  to: { scrollTop: 0 },
@@ -49,20 +48,20 @@ function U(p, i) {
49
48
  return /* @__PURE__ */ r(
50
49
  "div",
51
50
  {
52
- ...I(o),
53
- ref: i,
54
- className: q(
51
+ ...D(o),
52
+ ref: p,
53
+ className: S(
55
54
  `${s}`,
56
55
  { [`${s}-rtl`]: g },
57
56
  o.className
58
57
  ),
59
58
  style: o.style,
60
- onClick: c,
59
+ onClick: l,
61
60
  ...T({
62
- onPressEnter: c
61
+ onPressEnter: l
63
62
  }),
64
63
  children: /* @__PURE__ */ r(
65
- S,
64
+ R,
66
65
  {
67
66
  in: b,
68
67
  timeout: 100,
@@ -74,11 +73,11 @@ function U(p, i) {
74
73
  }
75
74
  );
76
75
  }
77
- const m = y(
78
- U
76
+ const a = y(
77
+ O
79
78
  );
80
- m.displayName = "BackTop";
81
- const _ = x.memo(m);
79
+ a.displayName = "BackTop";
80
+ const Z = k.memo(a);
82
81
  export {
83
- _ as default
82
+ Z as default
84
83
  };
package/badge/index.js CHANGED
@@ -1,58 +1,11 @@
1
- import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
- import q from "lodash/isPlainObject";
3
- import { forwardRef as z, useContext as H, useRef as O, useImperativeHandle as L } from "react";
1
+ import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
+ import _ from "lodash/isPlainObject";
3
+ import { forwardRef as q, useContext as z, useRef as H, useImperativeHandle as L } from "react";
4
4
  import "../config-provider/ConfigProvider.js";
5
- import M from "../components/common/hooks/useMergeProps.js";
6
- import "@unicom-cloud/utils/case-name";
7
- import n from "@unicom-cloud/utils/class-name";
8
- import "../dist/tinycolor/chunk/BOzCVdr0.js";
9
- import "@unicom-cloud/utils/constant/ui";
10
- import "../utils/contextHolder.js";
11
- import "@unicom-cloud/utils/dayjs";
12
- import "@unicom-cloud/utils/clipboard-copy";
13
- import "../components/common/utils/dayjs.js";
14
- import "../components/common/utils/dom.js";
15
- import "@unicom-cloud/utils/file/fileToURL";
16
- import "lodash/escapeRegExp";
17
- import "lodash/isArray";
18
- import "lodash/isNumber";
19
- import "lodash/isString";
20
- import "lodash/isFunction";
21
- import "lodash/throttle";
22
- import "../components/common/utils/is.js";
23
- import "lodash/camelCase";
24
- import "lodash/capitalize";
25
- import "lodash/cloneDeep";
26
- import "lodash/debounce";
27
- import "lodash/get";
28
- import "lodash/has";
29
- import "lodash/kebabCase";
30
- import "lodash/merge";
31
- import "lodash/mergeWith";
32
- import "lodash/set";
33
- import "lodash/setWith";
34
- import "lodash/snakeCase";
35
- import "lodash/startCase";
36
- import "lodash/uniq";
37
- import "lodash/upperFirst";
38
- import "@unicom-cloud/utils/math";
39
- import { PqbCSSTransition as U } from "../components/common/utils/PqbCSSTransition.js";
40
- import "../components/common/utils/reactDOM.js";
41
- import "../dist/react-transition-group/src/CSSTransition.js";
42
- import "../dist/react-transition-group/src/ReplaceTransition.js";
43
- import "../dist/react-transition-group/src/SwitchTransition.js";
44
- import "../dist/react-transition-group/chunk/CPfP7aNL.js";
45
- import "../dist/react-transition-group/src/TransitionGroup.js";
46
- import "@unicom-cloud/utils/file/saveAs";
47
- import "@unicom-cloud/utils/screenfull";
48
- import "@unicom-cloud/utils/constant/ui.js";
49
- import "react-is";
50
- import "@unicom-cloud/utils/tree";
51
- import "@unicom-cloud/utils/is";
52
- import { v4 as F } from "uuid";
53
- import "../dist/validate/src/index.js";
54
- import "@unicom-cloud/utils/constant/keyboardCode";
55
- import B from "./Count.js";
5
+ import U from "../components/common/hooks/useMergeProps.js";
6
+ import { PqbCSSTransition as F } from "../components/common/utils/PqbCSSTransition.js";
7
+ import l from "@unicom-cloud/utils/class-name";
8
+ import h from "./Count.js";
56
9
  import J from "../config-provider/context.js";
57
10
  const f = [
58
11
  "red",
@@ -72,164 +25,158 @@ const f = [
72
25
  dotAnimation: !0
73
26
  // 默认开启 dot 动画
74
27
  };
75
- function Q(P, v) {
76
- const { getPrefixCls: A, componentConfig: R, rtl: $ } = H(J), T = M(
77
- P,
28
+ function Q(O, B) {
29
+ const { getPrefixCls: D, componentConfig: P, rtl: $ } = z(J), R = U(
30
+ O,
78
31
  K,
79
- R?.Badge
32
+ P?.Badge
80
33
  ), {
81
- ribbon: o,
82
- count: s,
83
- prefixText: g,
84
- text: l,
85
- className: w,
86
- dotClassName: m,
87
- dot: b,
88
- dotAnimation: x,
89
- maxCount: E,
90
- color: r,
91
- dotStyle: j,
92
- offset: I,
93
- style: N,
94
- status: p,
95
- children: u,
96
- ...y
97
- } = T, d = O(null), C = O(F()), t = A?.("badge"), i = { ...j || {} }, [h, S] = I || [];
98
- h && (i.marginRight = -h), S && (i.marginTop = S), L(v, () => ({
99
- dom: d.current
34
+ ribbon: s,
35
+ count: n,
36
+ prefixText: b,
37
+ text: u,
38
+ className: A,
39
+ dotClassName: i,
40
+ dot: g,
41
+ dotAnimation: C,
42
+ maxCount: T,
43
+ color: t,
44
+ dotStyle: w,
45
+ offset: E,
46
+ style: j,
47
+ status: m,
48
+ children: N,
49
+ ...v
50
+ } = R, p = H(null), e = D?.("badge"), a = { ...w || {} }, [x, y] = E || [];
51
+ x && (a.marginRight = -x), y && (a.marginTop = y), L(B, () => ({
52
+ dom: p.current,
53
+ getRootDOMNode() {
54
+ return p.current;
55
+ }
100
56
  }));
101
57
  const k = () => {
102
- if (q(s))
103
- return /* @__PURE__ */ e(
58
+ if (_(n))
59
+ return /* @__PURE__ */ o(
104
60
  "span",
105
61
  {
106
- className: n(`${t}-custom-dot`, m),
107
- style: i,
108
- children: s
62
+ className: l(`${e}-custom-dot`, i),
63
+ style: a,
64
+ children: n
109
65
  }
110
66
  );
111
- const a = !r || f.indexOf(r) > -1 ? {} : { backgroundColor: r };
112
- return l && !r && !p ? /* @__PURE__ */ e(
67
+ const r = t ? f.includes(t) : !1, c = !t || r ? {} : { backgroundColor: t };
68
+ return u && !t && !m ? /* @__PURE__ */ o(
113
69
  "span",
114
70
  {
115
- className: n(`${t}-text`, m),
116
- style: i,
117
- children: l
71
+ className: l(`${e}-text`, i),
72
+ style: a,
73
+ children: u
118
74
  }
119
- ) : p || r && typeof s == "number" && s <= 0 ? /* @__PURE__ */ c("span", { className: `${t}-status-wrapper`, children: [
120
- !!g && /* @__PURE__ */ e("span", { className: `${t}-status-prefix-text`, children: g }),
121
- /* @__PURE__ */ e(
75
+ ) : m || t && typeof n == "number" && n <= 0 ? /* @__PURE__ */ d("span", { className: `${e}-status-wrapper`, children: [
76
+ !!b && /* @__PURE__ */ o("span", { className: `${e}-status-prefix-text`, children: b }),
77
+ /* @__PURE__ */ o(
122
78
  "span",
123
79
  {
124
- className: n(
125
- `${t}-status-dot`,
80
+ style: { ...c, ...a },
81
+ className: l(
82
+ `${e}-status-dot`,
126
83
  {
127
- [`${t}-dot-pulse`]: x,
128
- [`${t}-status-${p}`]: p,
129
- [`${t}-color-${r}`]: r
84
+ [`${e}-dot-pulse`]: C,
85
+ [`${e}-status-${m}`]: m,
86
+ [`${e}-color-${t}`]: t && r
130
87
  },
131
- m
132
- ),
133
- style: { ...a, ...i }
88
+ i
89
+ )
134
90
  }
135
91
  ),
136
- !!l && /* @__PURE__ */ e("span", { className: `${t}-status-text`, children: l })
137
- ] }) : (b || r) && typeof s == "number" && s > 0 ? /* @__PURE__ */ e(
138
- U,
92
+ !!u && /* @__PURE__ */ o("span", { className: `${e}-status-text`, children: u })
93
+ ] }) : (g || t) && typeof n == "number" && n > 0 ? /* @__PURE__ */ o(
94
+ F,
139
95
  {
140
96
  classNames: "badge-zoom",
141
- in: b || !!r,
97
+ in: g || !!t,
142
98
  timeout: 200,
143
99
  appear: !0,
144
100
  mountOnEnter: !0,
145
101
  unmountOnExit: !0,
146
- children: /* @__PURE__ */ e(
102
+ children: /* @__PURE__ */ o(
147
103
  "span",
148
104
  {
149
- className: n(
150
- `${t}-dot`,
105
+ className: l(
106
+ `${e}-dot`,
151
107
  {
152
- [`${t}-dot-pulse`]: x,
153
- [`${t}-color-${r}`]: r
108
+ [`${e}-dot-pulse`]: C,
109
+ [`${e}-color-${t}`]: t && r
154
110
  },
155
- m
111
+ i
156
112
  ),
157
- style: { ...a, ...i }
113
+ style: { ...c, ...a }
158
114
  }
159
115
  )
160
116
  }
161
- ) : /* @__PURE__ */ e(
162
- B,
117
+ ) : /* @__PURE__ */ o(
118
+ h,
163
119
  {
164
- prefixCls: t,
165
- className: n(`${t}-number`, m),
166
- style: { ...a, ...i },
167
- maxCount: E,
168
- count: s
120
+ prefixCls: e,
121
+ className: l(`${e}-number`, i),
122
+ style: { ...c, ...a },
123
+ maxCount: T,
124
+ count: n
169
125
  }
170
126
  );
171
127
  }, G = () => {
172
- if (!o || !o.text) return null;
173
- const a = o.color ? { backgroundColor: o.color } : {}, _ = o.placement || "end";
174
- return /* @__PURE__ */ c(
128
+ if (!s) return;
129
+ const r = s.color, c = r ? f.includes(r) : !1, I = {
130
+ ...c ? {} : { backgroundColor: r },
131
+ ...s.style
132
+ }, M = s.placement || "end";
133
+ return /* @__PURE__ */ d(
175
134
  "div",
176
135
  {
177
- className: n(
178
- `${t}-ribbon`,
179
- `${t}-ribbon-${_}`,
136
+ className: l(
137
+ `${e}-ribbon`,
138
+ `${e}-ribbon-${M}`,
180
139
  {
181
- [`${t}-rtl`]: $,
182
- [`${t}-color-${o.color}`]: o.color && f.includes(o.color)
183
- }
140
+ [`${e}-rtl`]: $,
141
+ [`${e}-color-${r}`]: r && c
142
+ },
143
+ s.className
184
144
  ),
185
- style: a,
145
+ style: I,
186
146
  children: [
187
- /* @__PURE__ */ e("span", { className: `${t}-ribbon-text`, children: o.text }),
188
- /* @__PURE__ */ e("div", { className: `${t}-ribbon-corner` })
147
+ /* @__PURE__ */ o("span", { className: `${e}-ribbon-text`, children: s.text }),
148
+ /* @__PURE__ */ o("div", { className: `${e}-ribbon-corner` })
189
149
  ]
190
150
  }
191
151
  );
192
152
  };
193
- return o ? /* @__PURE__ */ c(
194
- "div",
195
- {
196
- className: `${t}-ribbon-wrapper`,
197
- ref: d,
198
- style: N,
199
- id: C.current,
200
- ...y,
201
- children: [
202
- u,
203
- G()
204
- ]
205
- }
206
- ) : /* @__PURE__ */ c(
153
+ return /* @__PURE__ */ d(
207
154
  "span",
208
155
  {
209
- className: n(
210
- t,
156
+ className: l(
157
+ e,
211
158
  {
212
- [`${t}-status`]: p,
213
- [`${t}-no-children`]: !u,
214
- [`${t}-rtl`]: $
159
+ [`${e}-status`]: m,
160
+ [`${e}-no-children`]: !N,
161
+ [`${e}-rtl`]: $
215
162
  },
216
- w
163
+ !!s && `${e}-ribbon-wrapper`,
164
+ A
217
165
  ),
218
- ref: d,
219
- style: N,
220
- id: C.current,
221
- ...y,
166
+ ref: p,
167
+ style: j,
168
+ ...v,
222
169
  children: [
223
- u,
224
- k()
170
+ N,
171
+ s ? G() : k()
225
172
  ]
226
173
  }
227
174
  );
228
175
  }
229
- const D = z(Q);
230
- D.displayName = "Badge";
231
- D.Count = B;
232
- const Xt = f, Yt = [
176
+ const S = q(Q);
177
+ S.displayName = "Badge";
178
+ S.Count = h;
179
+ const se = f, ne = [
233
180
  "default",
234
181
  "processing",
235
182
  "success",
@@ -237,8 +184,8 @@ const Xt = f, Yt = [
237
184
  "error"
238
185
  ];
239
186
  export {
240
- Xt as BADGE_COLORS,
241
- Yt as BADGE_STATUS,
242
- B as BadgeCount,
243
- D as default
187
+ se as BADGE_COLORS,
188
+ ne as BADGE_STATUS,
189
+ h as BadgeCount,
190
+ S as default
244
191
  };