@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/modal/Modal.js CHANGED
@@ -1,13 +1,13 @@
1
- import { jsxs as T, jsx as r, Fragment as Ke } from "react/jsx-runtime";
1
+ import { jsxs as E, jsx as o, Fragment as Ke } from "react/jsx-runtime";
2
2
  import _e from "@unicom-cloud/icons/IconUiClose";
3
3
  import ue from "lodash/isFunction";
4
- import Ge, { forwardRef as Je, useRef as a, useContext as Qe, useState as k, useCallback as y, useEffect as q } from "react";
4
+ import Ge, { forwardRef as Je, useContext as Qe, useRef as i, useState as T, useCallback as k, useEffect as q } from "react";
5
5
  import de from "../button/index.js";
6
6
  import en from "../config-provider/ConfigProvider.js";
7
7
  import nn from "../components/common/hooks/useIsFirstRender.js";
8
8
  import tn from "../components/common/hooks/useMergeProps.js";
9
- import on from "../components/common/hooks/useMergeValue.js";
10
- import rn from "../components/common/hooks/useOverflowHidden.js";
9
+ import rn from "../components/common/hooks/useMergeValue.js";
10
+ import on from "../components/common/hooks/useOverflowHidden.js";
11
11
  import ln from "../icon-hover/index.js";
12
12
  import sn from "../portal/index.js";
13
13
  import { PqbCSSTransition as me } from "../components/common/utils/PqbCSSTransition.js";
@@ -41,9 +41,8 @@ const bn = {
41
41
  getPopupContainer: () => document.body,
42
42
  alignCenter: !0
43
43
  };
44
- function xn(l, b) {
45
- b ||= a();
46
- const d = Qe(gn), o = tn(
44
+ function xn(l, y) {
45
+ const d = Qe(gn), r = tn(
47
46
  l,
48
47
  bn,
49
48
  d.componentConfig?.Modal
@@ -52,7 +51,7 @@ function xn(l, b) {
52
51
  style: Ce,
53
52
  visible: s,
54
53
  simple: Z,
55
- title: x,
54
+ title: b,
56
55
  subtitle: N,
57
56
  children: be,
58
57
  cancelText: xe,
@@ -60,7 +59,7 @@ function xn(l, b) {
60
59
  okButtonProps: ve,
61
60
  cancelButtonProps: Me,
62
61
  getPopupContainer: D = () => document.body,
63
- footer: h,
62
+ footer: x,
64
63
  afterClose: we,
65
64
  confirmLoading: Ee,
66
65
  mountOnEnter: $,
@@ -68,7 +67,7 @@ function xn(l, b) {
68
67
  afterOpen: Te,
69
68
  hideCancel: ke,
70
69
  maskClosable: ye,
71
- mask: v,
70
+ mask: h,
72
71
  alignCenter: Ne,
73
72
  getChildrenPopupContainer: j,
74
73
  wrapClassName: De,
@@ -80,31 +79,31 @@ function xn(l, b) {
80
79
  fullscreenable: hn,
81
80
  okButton: m,
82
81
  ..._
83
- } = o, f = a(null), G = a(null), i = a(null), [J, Q] = k(), [ee, Re] = k(), M = a(null), p = a(!1), [Be, ne] = k(""), [te, oe] = k("");
82
+ } = r, f = i(null), G = i(null), a = i(null), [J, Q] = T(), [ee, Re] = T(), v = i(null), p = i(!1), [Be, ne] = T(""), [te, re] = T("");
84
83
  nn();
85
- const B = a(!0);
84
+ const B = i(!0);
86
85
  s && B.current && (B.current = !1);
87
- const w = a();
88
- w.current || (w.current = Cn++);
89
- const [Ie, I] = on(!1, {
86
+ const M = i();
87
+ M.current || (M.current = Cn++);
88
+ const [Ie, I] = rn(!1, {
90
89
  defaultValue: !1,
91
90
  value: Ee
92
- }), t = d.getPrefixCls?.("modal", o.prefixCls), { locale: O, rtl: re } = d, Oe = !Z || _.noticeType === "show", Xe = "closable" in o ? o.closable : Oe, Ye = y(() => mn(D()), [D]);
93
- rn(Ye, { hidden: s && v });
91
+ }), t = d.getPrefixCls?.("modal", r.prefixCls), { locale: O, rtl: oe } = d, Oe = !Z || _.noticeType === "show", Xe = "closable" in r ? r.closable : Oe, Ye = k(() => mn(D()), [D]);
92
+ on(Ye, { hidden: s && h });
94
93
  function X(e) {
95
94
  e.stopPropagation(), Y();
96
95
  }
97
96
  function Y() {
98
- o.onCancel?.();
97
+ r.onCancel?.();
99
98
  }
100
99
  const Le = (e) => {
101
100
  R && s && e.key === un.key && (e.stopPropagation(), Y());
102
- }, L = a(!1), Se = (e) => {
103
- p.current && (p.current = !1, !L.current && ye && v && e.target === e.currentTarget && setTimeout(() => {
101
+ }, L = i(!1), Se = (e) => {
102
+ p.current && (p.current = !1, !L.current && ye && h && e.target === e.currentTarget && setTimeout(() => {
104
103
  Y();
105
104
  }, 100));
106
105
  }, He = (e) => {
107
- const n = (o.onOk ?? o.onConfirm)?.(e);
106
+ const n = (r.onOk ?? r.onConfirm)?.(e);
108
107
  n?.then && (I(!0), n.then(
109
108
  () => {
110
109
  I(!1);
@@ -128,17 +127,17 @@ function xn(l, b) {
128
127
  isNaN(e) || Re(e + 1);
129
128
  }
130
129
  }, Ve = () => {
131
- if (h === null)
130
+ if (x === null)
132
131
  return;
133
- const e = o.cancelButton?.visible !== !1 && /* @__PURE__ */ r(
132
+ const e = r.cancelButton?.visible !== !1 && /* @__PURE__ */ o(
134
133
  de,
135
134
  {
136
135
  onClick: X,
137
136
  ...Me,
138
- ...o.cancelButton?.props,
139
- children: o.cancelButton?.props?.children || o.cancelButton?.label || o.cancelButton?.text || xe || O?.Modal.cancelText
137
+ ...r.cancelButton?.props,
138
+ children: r.cancelButton?.props?.children || r.cancelButton?.label || r.cancelButton?.text || xe || O?.Modal.cancelText
140
139
  }
141
- ), n = m?.visible !== !1 && /* @__PURE__ */ r(
140
+ ), n = m?.visible !== !1 && /* @__PURE__ */ o(
142
141
  de,
143
142
  {
144
143
  loading: Ie,
@@ -148,27 +147,27 @@ function xn(l, b) {
148
147
  ...m?.props,
149
148
  children: m?.props?.children || m?.label || m?.text || he || O?.Modal.okText
150
149
  }
151
- ), c = ue(h) ? h(e, n) : h || /* @__PURE__ */ T(Ke, { children: [
150
+ ), c = ue(x) ? x(e, n) : x || /* @__PURE__ */ E(Ke, { children: [
152
151
  !ke && e,
153
152
  n
154
153
  ] });
155
- return /* @__PURE__ */ r("div", { className: `${t}-footer`, children: c });
156
- }, S = a(
154
+ return /* @__PURE__ */ o("div", { className: `${t}-footer`, children: c });
155
+ }, S = i(
157
156
  ae()
158
- ), ze = y((e) => {
159
- if (!i.current) return;
157
+ ), ze = k((e) => {
158
+ if (!a.current) return;
160
159
  e.preventDefault();
161
160
  const n = S.current;
162
- n.screenX = e.screenX, n.screenY = e.screenY, n.prewTranslateX = n.translateX, n.prewTranslateY = n.translateY, n.boundingClientRect = i.current?.getBoundingClientRect?.() ?? {}, n.offsetParentBoundingClientRect = i.current?.offsetParent?.getBoundingClientRect?.() ?? {}, E(), qe();
163
- }, []), le = y((e) => {
161
+ n.screenX = e.screenX, n.screenY = e.screenY, n.prewTranslateX = n.translateX, n.prewTranslateY = n.translateY, n.boundingClientRect = a.current?.getBoundingClientRect?.() ?? {}, n.offsetParentBoundingClientRect = a.current?.offsetParent?.getBoundingClientRect?.() ?? {}, w(), qe();
162
+ }, []), le = k((e) => {
164
163
  e.preventDefault();
165
164
  const n = S.current, { left: c, right: V, top: z, bottom: Ze } = n.boundingClientRect ?? {}, { width: je, height: Ae } = n.offsetParentBoundingClientRect ?? {};
166
165
  let g = Math.max(e.screenX - n.screenX, -c);
167
166
  g = Math.min(g, je - V);
168
167
  let C = Math.max(e.screenY - n.screenY, -z);
169
168
  C = Math.min(C, Ae - Ze), g += n.prewTranslateX, C += n.prewTranslateY, n.translateX = g, n.translateY = C, ne(`translate(${g}px, ${C}px)`);
170
- }, []), se = y((e) => {
171
- e.preventDefault(), E();
169
+ }, []), se = k((e) => {
170
+ e.preventDefault(), w();
172
171
  }, []);
173
172
  function qe() {
174
173
  document.documentElement.addEventListener(
@@ -179,7 +178,7 @@ function xn(l, b) {
179
178
  se
180
179
  );
181
180
  }
182
- function E() {
181
+ function w() {
183
182
  document.documentElement.removeEventListener(
184
183
  "mousemove",
185
184
  le
@@ -201,36 +200,36 @@ function xn(l, b) {
201
200
  };
202
201
  }
203
202
  function H() {
204
- S.current = ae(), ne(""), oe("");
203
+ S.current = ae(), ne(""), re("");
205
204
  }
206
205
  q(() => () => {
207
- H(), E();
208
- }, []), q(() => (i.current || (H(), E()), () => {
209
- }), [i.current]);
210
- const Ue = /* @__PURE__ */ T(
206
+ H(), w();
207
+ }, []), q(() => (a.current || (H(), w()), () => {
208
+ }), [a.current]);
209
+ const Ue = /* @__PURE__ */ E(
211
210
  en,
212
211
  {
213
212
  ...d,
214
213
  childrenName: "Modal",
215
- prefixCls: o.prefixCls || d.prefixCls,
214
+ prefixCls: r.prefixCls || d.prefixCls,
216
215
  locale: O,
217
216
  zIndex: ee || 1050,
218
217
  getPopupContainer: (e) => typeof j == "function" ? j(e) : G.current,
219
218
  children: [
220
- (!!x || !!N) && /* @__PURE__ */ T("div", { className: `${t}-header`, children: [
221
- !!x && /* @__PURE__ */ r(
219
+ (!!b || !!N) && /* @__PURE__ */ E("div", { className: `${t}-header`, children: [
220
+ !!b && /* @__PURE__ */ o(
222
221
  "div",
223
222
  {
224
223
  className: `${t}-title`,
225
- id: `pqb-dialog-${w.current}`,
226
- children: x
224
+ id: `pqb-dialog-${M.current}`,
225
+ children: b
227
226
  }
228
227
  ),
229
- !!N && /* @__PURE__ */ r("div", { className: `${t}-subtitle`, children: N })
228
+ !!N && /* @__PURE__ */ o("div", { className: `${t}-subtitle`, children: N })
230
229
  ] }),
231
- /* @__PURE__ */ r("div", { ref: G, className: `${t}-content`, children: be }),
230
+ /* @__PURE__ */ o("div", { ref: G, className: `${t}-content`, children: be }),
232
231
  Ve(),
233
- !o.fullscreenable && o.draggable !== !1 && /* @__PURE__ */ r(
232
+ !r.fullscreenable && r.draggable !== !1 && /* @__PURE__ */ o(
234
233
  "div",
235
234
  {
236
235
  className: `${t}-drag-icon`,
@@ -238,14 +237,14 @@ function xn(l, b) {
238
237
  onDoubleClick: H
239
238
  }
240
239
  ),
241
- (Xe || !!o.fullscreenable) && (K !== void 0 ? /* @__PURE__ */ r(
240
+ (Xe || !!r.fullscreenable) && (K !== void 0 ? /* @__PURE__ */ o(
242
241
  "span",
243
242
  {
244
243
  className: `${t}-close-icon`,
245
244
  onClick: X,
246
245
  children: K
247
246
  }
248
- ) : /* @__PURE__ */ r(
247
+ ) : /* @__PURE__ */ o(
249
248
  ln,
250
249
  {
251
250
  tabIndex: -1,
@@ -253,12 +252,12 @@ function xn(l, b) {
253
252
  onClick: X,
254
253
  role: "button",
255
254
  "aria-label": "Close",
256
- children: /* @__PURE__ */ r(_e, {})
255
+ children: /* @__PURE__ */ o(_e, {})
257
256
  }
258
257
  ))
259
258
  ]
260
259
  }
261
- ), We = x ? { "aria-labelledby": `pqb-dialog-${w.current}` } : {}, ie = /* @__PURE__ */ r(
260
+ ), We = b ? { "aria-labelledby": `pqb-dialog-${M.current}` } : {}, ie = /* @__PURE__ */ o(
262
261
  "div",
263
262
  {
264
263
  role: "dialog",
@@ -268,8 +267,8 @@ function xn(l, b) {
268
267
  t,
269
268
  {
270
269
  [`${t}-simple`]: Z,
271
- [`${t}-rtl`]: re,
272
- [`${t}-fullscreenable`]: o.fullscreenable
270
+ [`${t}-rtl`]: oe,
271
+ [`${t}-fullscreenable`]: r.fullscreenable
273
272
  },
274
273
  ge
275
274
  ),
@@ -278,32 +277,32 @@ function xn(l, b) {
278
277
  transform: Be,
279
278
  transformOrigin: te
280
279
  },
281
- ref: i,
280
+ ref: a,
282
281
  children: Ue
283
282
  }
284
283
  ), F = (e) => {
285
284
  if (te)
286
285
  return;
287
286
  let n = "";
288
- if (M.current) {
289
- const c = e.getBoundingClientRect(), { left: V, top: z } = M.current;
287
+ if (v.current) {
288
+ const c = e.getBoundingClientRect(), { left: V, top: z } = v.current;
290
289
  n = `${V - c.left}px ${z - c.top}px`;
291
290
  }
292
- oe(n);
293
- }, ce = B.current ? !$ : !!i.current;
294
- return s || ce ? /* @__PURE__ */ r(
291
+ re(n);
292
+ }, ce = B.current ? !$ : !!a.current;
293
+ return s || ce ? /* @__PURE__ */ o(
295
294
  sn,
296
295
  {
297
296
  visible: s,
298
297
  forceRender: ce,
299
298
  getContainer: D,
300
- children: /* @__PURE__ */ T(
299
+ children: /* @__PURE__ */ E(
301
300
  "div",
302
301
  {
303
- ref: b,
302
+ ref: y,
304
303
  className: `${t}-container`,
305
304
  children: [
306
- v ? /* @__PURE__ */ r(
305
+ h ? /* @__PURE__ */ o(
307
306
  me,
308
307
  {
309
308
  in: s,
@@ -318,7 +317,7 @@ function xn(l, b) {
318
317
  onExited: (e) => {
319
318
  e && (e.style.display = "none");
320
319
  },
321
- children: /* @__PURE__ */ r(
320
+ children: /* @__PURE__ */ o(
322
321
  "div",
323
322
  {
324
323
  "aria-hidden": !0,
@@ -328,7 +327,7 @@ function xn(l, b) {
328
327
  )
329
328
  }
330
329
  ) : null,
331
- /* @__PURE__ */ r(
330
+ /* @__PURE__ */ o(
332
331
  "div",
333
332
  {
334
333
  ...dn(_, [
@@ -350,9 +349,9 @@ function xn(l, b) {
350
349
  className: fe(
351
350
  `${t}-wrapper`,
352
351
  {
353
- [`${t}-wrapper-no-mask`]: !v,
352
+ [`${t}-wrapper-no-mask`]: !h,
354
353
  [`${t}-wrapper-align-center`]: Ne,
355
- [`${t}-wrapper-rtl`]: re
354
+ [`${t}-wrapper-rtl`]: oe
356
355
  },
357
356
  De
358
357
  ),
@@ -367,7 +366,7 @@ function xn(l, b) {
367
366
  p.current = e.target === e.currentTarget;
368
367
  },
369
368
  onClick: Se,
370
- children: /* @__PURE__ */ r(
369
+ children: /* @__PURE__ */ o(
371
370
  me,
372
371
  {
373
372
  in: s,
@@ -377,16 +376,16 @@ function xn(l, b) {
377
376
  unmountOnExit: P,
378
377
  mountOnEnter: $,
379
378
  onEnter: (e) => {
380
- e && (Q(!0), M.current = U, F(e), i.current = e);
379
+ e && (Q(!0), v.current = U, F(e), a.current = e);
381
380
  },
382
381
  onEntered: (e) => {
383
- e && (F(e), M.current = null, Te?.());
382
+ e && (F(e), v.current = null, Te?.());
384
383
  },
385
384
  onExit: () => {
386
385
  L.current = !0;
387
386
  },
388
387
  onExited: (e) => {
389
- e && (Q(!1), F(e), we?.(), L.current = !1, P && (i.current = null));
388
+ e && (Q(!1), F(e), we?.(), L.current = !1, P && (a.current = null));
390
389
  },
391
390
  children: Ge.cloneElement(
392
391
  ue(A) ? A(ie) : ie,
@@ -418,8 +417,8 @@ u.show = (l) => W({ ...l, noticeType: "show" });
418
417
  u.confirm = (l) => W(l);
419
418
  u.useModal = pn;
420
419
  ["info", "success", "warning", "error"].forEach((l) => {
421
- u[l] = (b) => W({
422
- ...b,
420
+ u[l] = (y) => W({
421
+ ...y,
423
422
  isNotice: !0,
424
423
  noticeType: l
425
424
  });
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@unicom-cloud/ui","version":"0.8.100","dependencies":{"@unicom-cloud/icons":"latest"},"peerDependencies":{"dayjs":"^1.11.10","lodash":"^4.17.21","react":"^18.3.1","react-dom":"^18.3.1"},"peerDependenciesMeta":{},"type":"module","types":"types/pc/index.d.ts","main":"./index.js","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
1
+ {"name":"@unicom-cloud/ui","version":"0.8.102","dependencies":{"@unicom-cloud/icons":"latest"},"peerDependencies":{"dayjs":"^1.11.10","lodash":"^4.17.21","react":"^18.3.1","react-dom":"^18.3.1"},"peerDependenciesMeta":{},"type":"module","types":"types/pc/index.d.ts","main":"./index.js","publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"}}
@@ -0,0 +1 @@
1
+
package/qr-code/index.js CHANGED
@@ -13,12 +13,11 @@ import R from "../components/common/hooks/useMergeProps.js";
13
13
  import "../components/common/utils/reactDOM.js";
14
14
  import "@unicom-cloud/utils/constant";
15
15
  import "lodash/debounce";
16
+ import "@unicom-cloud/utils/date";
16
17
  import "@unicom-cloud/utils/case-name";
17
18
  import S from "@unicom-cloud/utils/class-name";
18
- import "../dist/tinycolor/chunk/BOzCVdr0.js";
19
19
  import "@unicom-cloud/utils/constant/ui";
20
20
  import "../utils/contextHolder.js";
21
- import "@unicom-cloud/utils/dayjs";
22
21
  import "@unicom-cloud/utils/clipboard-copy";
23
22
  import "../components/common/utils/dayjs.js";
24
23
  import "@unicom-cloud/utils/file/fileToURL";
@@ -49,6 +48,8 @@ import "../dist/react-transition-group/chunk/CPfP7aNL.js";
49
48
  import "../dist/react-transition-group/src/TransitionGroup.js";
50
49
  import "@unicom-cloud/utils/file/saveAs";
51
50
  import "@unicom-cloud/utils/screenfull";
51
+ import "@unicom-cloud/utils/tinycolor";
52
+ import "@unicom-cloud/utils/ui-color";
52
53
  import "@unicom-cloud/utils/constant/ui.js";
53
54
  import "react-is";
54
55
  import "@unicom-cloud/utils/tree";
@@ -65,7 +66,7 @@ const q = {
65
66
  bgColor: "#ffffff",
66
67
  marginSize: 0,
67
68
  value: "qr-code"
68
- }, $o = (e) => {
69
+ }, jo = (e) => {
69
70
  const { getPrefixCls: s, componentConfig: n } = Q(h), d = R(
70
71
  e,
71
72
  q,
@@ -113,5 +114,5 @@ const q = {
113
114
  );
114
115
  };
115
116
  export {
116
- $o as default
117
+ jo as default
117
118
  };
@@ -1,10 +1,10 @@
1
- import { jsxs as D, jsx as w, Fragment as ee } from "react/jsx-runtime";
2
- import { forwardRef as te, useContext as ne, useMemo as re, useState as P, useRef as N, useCallback as oe, useEffect as A } from "react";
1
+ import { jsxs as D, jsx as w, Fragment as te } from "react/jsx-runtime";
2
+ import { forwardRef as ne, useContext as re, useMemo as oe, useState as P, useRef as N, useCallback as se, useEffect as A } from "react";
3
3
  import "../config-provider/ConfigProvider.js";
4
4
  import ae from "../components/common/hooks/useMergeProps.js";
5
- import E from "@unicom-cloud/utils/class-name";
6
- import { resizeObserver as se } from "../components/common/utils/resizeObserver.js";
7
- import ie from "../config-provider/context.js";
5
+ import j from "@unicom-cloud/utils/class-name";
6
+ import { resizeObserver as ie } from "../components/common/utils/resizeObserver.js";
7
+ import le from "../config-provider/context.js";
8
8
  const ce = {
9
9
  options: [],
10
10
  size: "medium",
@@ -14,12 +14,12 @@ const ce = {
14
14
  direction: "horizontal",
15
15
  showIndicator: !0,
16
16
  animationDuration: 300
17
- }, le = te(
18
- (M, d) => {
19
- const { getPrefixCls: j, componentConfig: B, rtl: K } = ne(ie), L = ae(
20
- M,
17
+ }, ue = ne(
18
+ (B, d) => {
19
+ const { getPrefixCls: E, componentConfig: M, rtl: K } = re(le), L = ae(
20
+ B,
21
21
  ce,
22
- B?.Segmented
22
+ M?.Segmented
23
23
  ), {
24
24
  style: U,
25
25
  className: F,
@@ -36,7 +36,7 @@ const ce = {
36
36
  name: x,
37
37
  onChange: C,
38
38
  ...G
39
- } = L, a = re(() => O.map((e) => typeof e == "string" ? { value: e, label: e } : e), [O]), [J, V] = P(() => y && a.some((e) => e.value === y) ? y : a[0]?.value || ""), [Q, m] = P({}), l = N(null), k = N([]), S = N(!1), r = j?.("segmented"), T = E(
39
+ } = L, s = oe(() => O.map((e) => typeof e == "string" ? { value: e, label: e } : e), [O]), [J, S] = P(() => y && s.some((e) => e.value === y) ? y : s[0]?.value || ""), [Q, m] = P({}), c = N(null), k = N([]), V = N(!1), r = E?.("segmented"), T = j(
40
40
  r,
41
41
  {
42
42
  [`${r}-block`]: _,
@@ -46,24 +46,24 @@ const ce = {
46
46
  [`${r}-${p}`]: p
47
47
  },
48
48
  F
49
- ), h = R !== void 0, i = h ? R : J, b = oe(() => {
50
- if (!$ || !l.current) {
51
- m((s) => ({ ...s, opacity: 0 }));
49
+ ), h = R !== void 0, i = h ? R : J, b = se(() => {
50
+ if (!$ || !c.current) {
51
+ m((a) => ({ ...a, opacity: 0 }));
52
52
  return;
53
53
  }
54
- const e = a.findIndex(
55
- (s) => s?.value === i
54
+ const e = s.findIndex(
55
+ (a) => a?.value === i
56
56
  );
57
57
  if (e === -1) {
58
- m((s) => ({ ...s, opacity: 0 }));
58
+ m((a) => ({ ...a, opacity: 0 }));
59
59
  return;
60
60
  }
61
61
  const o = k.current[e];
62
62
  if (!o) {
63
- m((s) => ({ ...s, opacity: 0 }));
63
+ m((a) => ({ ...a, opacity: 0 }));
64
64
  return;
65
65
  }
66
- const n = l.current.getBoundingClientRect(), t = o.getBoundingClientRect(), c = p === "vertical" ? {
66
+ const n = c.current.getBoundingClientRect(), t = o.getBoundingClientRect(), l = p === "vertical" ? {
67
67
  width: t.width,
68
68
  // 垂直模式下宽度撑满
69
69
  top: t.top - n.top,
@@ -75,14 +75,14 @@ const ce = {
75
75
  // 水平模式下高度撑满
76
76
  };
77
77
  m({
78
- ...c,
78
+ ...l,
79
79
  opacity: 1
80
80
  });
81
- }, [i, a, $, p]), z = (e, o) => {
82
- o || f || (h || V(e), C?.(e));
81
+ }, [i, s, $, p]), z = (e, o) => {
82
+ o || f || (h || S(e), C?.(e));
83
83
  }, W = (e, o) => {
84
84
  if (f) return;
85
- const n = a.length;
85
+ const n = s.length;
86
86
  if (n === 0) return;
87
87
  let t = o;
88
88
  switch (e.key) {
@@ -103,26 +103,26 @@ const ce = {
103
103
  default:
104
104
  return;
105
105
  }
106
- for (; t !== o && a[t]?.disabled; )
106
+ for (; t !== o && s[t]?.disabled; )
107
107
  t = (t + (e.key === "ArrowLeft" || e.key === "ArrowUp" ? -1 : 1) + n) % n;
108
- const c = a[t]?.value;
109
- c && c !== i && (z(c), k.current[t]?.focus());
108
+ const l = s[t]?.value;
109
+ l && l !== i && (z(l), k.current[t]?.focus());
110
110
  };
111
111
  A(() => {
112
- if (!S.current) {
113
- S.current = !0;
112
+ if (!V.current) {
113
+ V.current = !0;
114
114
  return;
115
115
  }
116
- if (!a.some((e) => e.value === i)) {
117
- const e = a[0]?.value || "";
118
- h || V(e), C?.(e);
116
+ if (!s.some((e) => e.value === i)) {
117
+ const e = s[0]?.value || "";
118
+ h || S(e), C?.(e);
119
119
  }
120
- }, [a, i, h, C]), A(() => {
120
+ }, [s, i, h, C]), A(() => {
121
121
  b();
122
- }, [i, a, b]), A(() => {
123
- if (!l.current) return;
124
- const e = se(
125
- [l.current],
122
+ }, [i, s, b]), A(() => {
123
+ if (!c.current) return;
124
+ const e = ie(
125
+ [c.current],
126
126
  () => {
127
127
  b();
128
128
  }
@@ -135,7 +135,7 @@ const ce = {
135
135
  if (e.render)
136
136
  return e.render(e, o);
137
137
  const n = !e.label && !!e.icon;
138
- return /* @__PURE__ */ D(ee, { children: [
138
+ return /* @__PURE__ */ D(te, { children: [
139
139
  e.icon && /* @__PURE__ */ w("span", { className: `${r}-option-icon`, children: e.icon }),
140
140
  !n && e.label && /* @__PURE__ */ w("span", { className: `${r}-option-label`, children: e.label })
141
141
  ] });
@@ -144,28 +144,28 @@ const ce = {
144
144
  "div",
145
145
  {
146
146
  ref: (e) => {
147
- typeof d == "function" ? d(e) : d && (d.current = e), l.current = e;
147
+ typeof d == "function" ? d(e) : d && (d.current = e), c.current = e;
148
148
  },
149
149
  ...G,
150
150
  style: U,
151
151
  className: T,
152
152
  role: "radiogroup",
153
153
  children: [
154
- !Array.isArray(a) || a.length === 0 ? null : a.map((e, o) => {
154
+ !Array.isArray(s) || s.length === 0 ? null : s.map((e, o) => {
155
155
  if (!e) return null;
156
156
  const {
157
157
  value: n,
158
158
  label: t,
159
- disabled: c,
160
- icon: s,
161
- render: de,
159
+ disabled: l,
160
+ icon: a,
161
+ render: fe,
162
162
  ...Y
163
- } = e, u = n === i, g = c || f, Z = !t && !!s;
163
+ } = e, u = n === i, g = l || f, Z = !t && !!a, ee = [t, n, o].filter(Boolean).join("-");
164
164
  return /* @__PURE__ */ D(
165
165
  "button",
166
166
  {
167
167
  ref: (I) => k.current[o] = I,
168
- className: E(
168
+ className: j(
169
169
  `${r}-option`,
170
170
  `${r}-option-${H}`,
171
171
  `${r}-option-${v}`,
@@ -201,7 +201,7 @@ const ce = {
201
201
  X(e, u)
202
202
  ]
203
203
  },
204
- n + o
204
+ ee
205
205
  );
206
206
  }),
207
207
  $ && /* @__PURE__ */ w(
@@ -219,7 +219,7 @@ const ce = {
219
219
  );
220
220
  }
221
221
  );
222
- le.displayName = "Segmented";
222
+ ue.displayName = "Segmented";
223
223
  export {
224
- le as default
224
+ ue as default
225
225
  };