@unicom-cloud/ui 0.8.99 → 0.8.101

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 (293) hide show
  1. package/Anchor.js +3 -1
  2. package/Badge.js +7 -6
  3. package/Copy.js +49 -2
  4. package/Details.js +13 -2
  5. package/Divider.js +3 -2
  6. package/Flex.js +22 -0
  7. package/Grid.js +1 -1
  8. package/LiquidFill.js +3 -2
  9. package/Loading.js +16 -3
  10. package/Marquee.js +3 -2
  11. package/QrCode.js +3 -2
  12. package/Space.js +3 -3
  13. package/Splitter.js +5 -5
  14. package/SuspenseFallbackTest.js +2 -4
  15. package/Tag.js +3 -2
  16. package/Tour.js +3 -2
  17. package/alert/index.js +61 -64
  18. package/anchor/index.js +5 -3
  19. package/back-top/index.js +32 -33
  20. package/badge/index.js +19 -18
  21. package/calendar/index.js +85 -84
  22. package/components/common/development/index.js +44 -29
  23. package/components/common/empty/index.js +35 -23
  24. package/components/common/flex/index.js +64 -0
  25. package/components/common/flex/interface.js +9 -0
  26. package/components/common/higher-order/with-speech-synthesis/index.js +79 -55
  27. package/components/common/space/index.js +71 -91
  28. package/components/common/suspense-fallback-test/index.js +16 -0
  29. package/components/common/utils/toArray.js +12 -0
  30. package/copy/index.js +83 -35
  31. package/details/index.js +102 -62
  32. package/divider/index.js +27 -21
  33. package/empty/index.js +13 -13
  34. package/flex/index.js +47 -0
  35. package/flex/interface.js +1 -0
  36. package/grid/{GridItem.js → Item.js} +15 -15
  37. package/grid/index.js +1 -1
  38. package/icon/interface.js +1 -0
  39. package/icon-hover/interface.js +1 -0
  40. package/index.js +610 -599
  41. package/input/Button.js +39 -34
  42. package/input/Textarea.js +108 -104
  43. package/liquid-fill/index.js +3 -2
  44. package/loading/index.js +72 -53
  45. package/loading/interface.js +1 -0
  46. package/marquee/index.js +3 -2
  47. package/modal/Modal.js +73 -74
  48. package/package.json +1 -1
  49. package/portal/interface.js +1 -0
  50. package/qr-code/index.js +3 -2
  51. package/segmented/index.js +113 -105
  52. package/space/index.js +41 -35
  53. package/speech-synthesis/interface.js +1 -0
  54. package/spin/index.js +75 -62
  55. package/splitter/Panel.js +39 -0
  56. package/splitter/SplitBar.js +157 -0
  57. package/splitter/Splitter.js +135 -0
  58. package/splitter/hooks/useEvent.js +12 -0
  59. package/splitter/hooks/useItems.js +26 -0
  60. package/splitter/hooks/useResizable.js +26 -0
  61. package/splitter/hooks/useResize.js +68 -0
  62. package/splitter/hooks/useSizes.js +60 -0
  63. package/splitter/index.js +6 -115
  64. package/style.css +1 -1
  65. package/suspense-fallback-test/index.js +2 -11
  66. package/suspense-fallback-test/interface.js +1 -0
  67. package/table/Table.js +38 -38
  68. package/table/hook/useThResizable.js +72 -26
  69. package/table/tbody/Td.js +80 -77
  70. package/table/th-resizable/index.js +92 -35
  71. package/tag/index.js +42 -41
  72. package/tooltip/index.js +89 -82
  73. package/tour/index.js +5 -6
  74. package/trigger/index.js +67 -70
  75. package/types/common/development/index.d.ts +7 -1
  76. package/types/common/development/interface.d.ts +22 -0
  77. package/types/common/empty/index.d.ts +2 -1
  78. package/types/common/flex/index.d.ts +14 -0
  79. package/types/common/flex/interface.d.ts +62 -0
  80. package/types/common/higher-order/with-speech-synthesis/index.d.ts +6 -1
  81. package/types/common/higher-order/with-speech-synthesis/interface.d.ts +13 -0
  82. package/types/common/space/index.d.ts +4 -3
  83. package/types/common/space/interface.d.ts +10 -18
  84. package/types/common/suspense-fallback-test/index.d.ts +7 -0
  85. package/types/common/suspense-fallback-test/interface.d.ts +1 -0
  86. package/types/common/utils/PqbCSSTransition.d.ts +1 -1
  87. package/types/common/utils/toArray.d.ts +13 -0
  88. package/types/pc/affix/interface.d.ts +0 -2
  89. package/types/pc/alert/index.d.ts +3 -2
  90. package/types/pc/alert/interface.d.ts +7 -1
  91. package/types/pc/anchor/index.d.ts +2 -1
  92. package/types/pc/anchor/interface.d.ts +0 -2
  93. package/types/pc/auto-complete/interface.d.ts +0 -6
  94. package/types/pc/avatar/interface.d.ts +0 -4
  95. package/types/pc/badge/Count.d.ts +1 -1
  96. package/types/pc/breadcrumb/Item.d.ts +1 -1
  97. package/types/pc/breadcrumb/interface.d.ts +0 -3
  98. package/types/pc/calendar/Month.d.ts +1 -1
  99. package/types/pc/calendar/WeekList.d.ts +1 -1
  100. package/types/pc/calendar/Year.d.ts +1 -1
  101. package/types/pc/calendar/header/Panel.d.ts +1 -1
  102. package/types/pc/calendar/header/index.d.ts +1 -1
  103. package/types/pc/calendar/index.d.ts +1 -1
  104. package/types/pc/calendar/interface.d.ts +2 -1
  105. package/types/pc/carousel/interface.d.ts +2 -6
  106. package/types/pc/cascader/interface.d.ts +7 -19
  107. package/types/pc/cascader/panel/List.d.ts +1 -1
  108. package/types/pc/cascader/panel/Option.d.ts +1 -1
  109. package/types/pc/cascader/panel/Search.d.ts +1 -1
  110. package/types/pc/checkbox/Group.d.ts +2 -2
  111. package/types/pc/checkbox/GroupBlock.d.ts +1 -1
  112. package/types/pc/checkbox/IconCheck.d.ts +1 -1
  113. package/types/pc/checkbox/interface.d.ts +0 -1
  114. package/types/pc/collapse/interface.d.ts +0 -2
  115. package/types/pc/color-picker/InputRgb.d.ts +1 -1
  116. package/types/pc/color-picker/Palette.d.ts +1 -1
  117. package/types/pc/color-picker/interface.d.ts +0 -2
  118. package/types/pc/config-provider/ConfigProvider.d.ts +1 -1
  119. package/types/pc/config-provider/interface.d.ts +17 -17
  120. package/types/pc/copy/index.d.ts +1 -1
  121. package/types/pc/copy/interface.d.ts +2 -1
  122. package/types/pc/date-picker/interface.d.ts +0 -17
  123. package/types/pc/date-picker/panel/Body.d.ts +1 -1
  124. package/types/pc/date-picker/panel/Footer.d.ts +1 -1
  125. package/types/pc/date-picker/panel/Header.d.ts +1 -1
  126. package/types/pc/date-picker/panel/WeekList.d.ts +1 -1
  127. package/types/pc/date-picker/panel/date/index.d.ts +1 -1
  128. package/types/pc/date-picker/panel/month/index.d.ts +1 -1
  129. package/types/pc/date-picker/panel/quarter/index.d.ts +1 -1
  130. package/types/pc/date-picker/panel/range/index.d.ts +1 -1
  131. package/types/pc/date-picker/panel/week/index.d.ts +1 -1
  132. package/types/pc/date-picker/panel/year/index.d.ts +1 -1
  133. package/types/pc/descriptions/index.d.ts +1 -1
  134. package/types/pc/descriptions/interface.d.ts +0 -1
  135. package/types/pc/details/index.d.ts +3 -2
  136. package/types/pc/details/interface.d.ts +16 -0
  137. package/types/pc/development/index.d.ts +2 -1
  138. package/types/pc/development/interface.d.ts +15 -0
  139. package/types/pc/divider/index.d.ts +7 -2
  140. package/types/pc/draggable/Item.d.ts +1 -1
  141. package/types/pc/draggable/index.d.ts +1 -1
  142. package/types/pc/drawer/interface.d.ts +0 -7
  143. package/types/pc/dropdown/interface.d.ts +0 -1
  144. package/types/pc/flex/index.d.ts +9 -0
  145. package/types/pc/flex/interface.d.ts +16 -0
  146. package/types/pc/form/Control.d.ts +1 -1
  147. package/types/pc/form/FormList.d.ts +1 -1
  148. package/types/pc/form/IconSymbol.d.ts +1 -1
  149. package/types/pc/form/interface.d.ts +9 -22
  150. package/types/pc/form/util.d.ts +1 -1
  151. package/types/pc/grid/index.d.ts +3 -3
  152. package/types/pc/grid/interface.d.ts +1 -6
  153. package/types/pc/icon/addFromIconFontCn.d.ts +1 -7
  154. package/types/pc/icon/index.d.ts +2 -7
  155. package/types/pc/icon/interface.d.ts +13 -0
  156. package/types/pc/icon-hover/index.d.ts +2 -8
  157. package/types/pc/icon-hover/interface.d.ts +8 -0
  158. package/types/pc/image/ImageFooter.d.ts +1 -1
  159. package/types/pc/image/ImagePreviewArrow.d.ts +1 -1
  160. package/types/pc/image/TriggerForToolbar.d.ts +1 -1
  161. package/types/pc/image/interface.d.ts +0 -13
  162. package/types/pc/index.d.ts +63 -50
  163. package/types/pc/input/Textarea.d.ts +2 -6
  164. package/types/pc/input/interface.d.ts +5 -13
  165. package/types/pc/input-number/interface.d.ts +0 -4
  166. package/types/pc/input-tag/interface.d.ts +0 -13
  167. package/types/pc/layout/interface.d.ts +0 -1
  168. package/types/pc/link/interface.d.ts +0 -1
  169. package/types/pc/list/interface.d.ts +0 -4
  170. package/types/pc/loading/index.d.ts +4 -3
  171. package/types/pc/loading/interface.d.ts +6 -0
  172. package/types/pc/menu/Indent.d.ts +1 -1
  173. package/types/pc/menu/OverflowWrap.d.ts +1 -1
  174. package/types/pc/menu/interface.d.ts +0 -8
  175. package/types/pc/menu/sub-menu/Inline.d.ts +1 -1
  176. package/types/pc/menu/sub-menu/Pop.d.ts +1 -1
  177. package/types/pc/message/interface.d.ts +0 -2
  178. package/types/pc/modal/interface.d.ts +0 -5
  179. package/types/pc/notification/interface.d.ts +0 -1
  180. package/types/pc/overflow-ellipsis/OverflowItem.d.ts +1 -1
  181. package/types/pc/overflow-ellipsis/index.d.ts +1 -1
  182. package/types/pc/pagination/PageItem.d.ts +3 -3
  183. package/types/pc/pagination/PageJumper.d.ts +1 -1
  184. package/types/pc/pagination/PageOption.d.ts +1 -1
  185. package/types/pc/pagination/interface.d.ts +0 -2
  186. package/types/pc/popconfirm/interface.d.ts +8 -10
  187. package/types/pc/popover/interface.d.ts +0 -1
  188. package/types/pc/portal/Portal.d.ts +2 -6
  189. package/types/pc/portal/index.d.ts +2 -9
  190. package/types/pc/portal/interface.d.ts +14 -0
  191. package/types/pc/progress/CircleProgress.d.ts +1 -1
  192. package/types/pc/progress/LineProgess.d.ts +1 -1
  193. package/types/pc/progress/StepProgress.d.ts +1 -1
  194. package/types/pc/progress/interface.d.ts +0 -3
  195. package/types/pc/radio/Group.d.ts +2 -2
  196. package/types/pc/radio/GroupBlock.d.ts +1 -1
  197. package/types/pc/radio/Radio.d.ts +1 -1
  198. package/types/pc/resize-box/ResizeTrigger.d.ts +1 -1
  199. package/types/pc/resize-box/interface.d.ts +1 -7
  200. package/types/pc/result/403.d.ts +1 -1
  201. package/types/pc/result/404.d.ts +1 -1
  202. package/types/pc/result/500.d.ts +1 -1
  203. package/types/pc/segmented/interface.d.ts +6 -6
  204. package/types/pc/select/interface.d.ts +0 -12
  205. package/types/pc/select-view/interface.d.ts +0 -7
  206. package/types/pc/skeleton/Image.d.ts +1 -1
  207. package/types/pc/skeleton/Text.d.ts +2 -1
  208. package/types/pc/slider/Button.d.ts +1 -1
  209. package/types/pc/slider/Input.d.ts +1 -1
  210. package/types/pc/slider/Tick.d.ts +1 -1
  211. package/types/pc/slider/interface.d.ts +0 -4
  212. package/types/pc/space/index.d.ts +7 -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/spin/interface.d.ts +4 -1
  217. package/types/pc/splitter/Panel.d.ts +8 -0
  218. package/types/pc/splitter/SplitBar.d.ts +21 -0
  219. package/types/pc/splitter/Splitter.d.ts +4 -0
  220. package/types/pc/splitter/hooks/useEvent.d.ts +3 -0
  221. package/types/pc/splitter/hooks/useItems.d.ts +10 -0
  222. package/types/pc/splitter/hooks/useResizable.d.ts +8 -0
  223. package/types/pc/splitter/hooks/useResize.d.ts +4 -0
  224. package/types/pc/splitter/hooks/useSizes.d.ts +5 -0
  225. package/types/pc/splitter/index.d.ts +8 -3
  226. package/types/pc/splitter/interface.d.ts +181 -38
  227. package/types/pc/statistic/interface.d.ts +0 -4
  228. package/types/pc/steps/interface.d.ts +0 -3
  229. package/types/pc/suspense-fallback-test/index.d.ts +2 -3
  230. package/types/pc/suspense-fallback-test/interface.d.ts +2 -0
  231. package/types/pc/table/ColGroup.d.ts +1 -1
  232. package/types/pc/table/hook/useThResizable.d.ts +2 -2
  233. package/types/pc/table/interface.d.ts +4 -15
  234. package/types/pc/table/summary/Cell.d.ts +1 -1
  235. package/types/pc/table/summary/Row.d.ts +1 -1
  236. package/types/pc/table/tbody/Td.d.ts +1 -1
  237. package/types/pc/table/tbody/index.d.ts +1 -1
  238. package/types/pc/table/tfoot/index.d.ts +1 -1
  239. package/types/pc/table/th-resizable/index.d.ts +1 -1
  240. package/types/pc/table/thead/Column.d.ts +1 -1
  241. package/types/pc/table/thead/index.d.ts +1 -1
  242. package/types/pc/tabs/TabContent.d.ts +1 -1
  243. package/types/pc/tabs/interface.d.ts +0 -7
  244. package/types/pc/tabs/tab-header/DropdownIcon.d.ts +1 -1
  245. package/types/pc/tabs/tab-header/TabInk.d.ts +1 -1
  246. package/types/pc/tabs/tab-header/TabNavIcon.d.ts +1 -1
  247. package/types/pc/tag/index.d.ts +2 -0
  248. package/types/pc/tag/interface.d.ts +0 -1
  249. package/types/pc/time-picker/Picker.d.ts +1 -1
  250. package/types/pc/time-picker/RangePicker.d.ts +1 -1
  251. package/types/pc/time-picker/TimeColumn.d.ts +1 -1
  252. package/types/pc/time-picker/TimePicker.d.ts +1 -1
  253. package/types/pc/time-picker/index.d.ts +1 -1
  254. package/types/pc/time-picker/interface.d.ts +0 -7
  255. package/types/pc/tooltip/interface.d.ts +4 -1
  256. package/types/pc/transfer/Item.d.ts +1 -1
  257. package/types/pc/transfer/List.d.ts +1 -1
  258. package/types/pc/transfer/interface.d.ts +2 -9
  259. package/types/pc/tree/Animation.d.ts +1 -1
  260. package/types/pc/tree/interface.d.ts +2 -8
  261. package/types/pc/tree-select/interface.d.ts +0 -8
  262. package/types/pc/trigger/interface.d.ts +0 -5
  263. package/types/pc/typography/EditContent.d.ts +2 -1
  264. package/types/pc/typography/Operations.d.ts +1 -1
  265. package/types/pc/typography/interface.d.ts +45 -30
  266. package/types/pc/upload/interface.d.ts +6 -11
  267. package/types/pc/upload/list/index.d.ts +1 -1
  268. package/types/pc/utils/index.d.ts +1 -0
  269. package/types/pc/utils/names.d.ts +6 -0
  270. package/types/pc/utils/toArray.d.ts +3 -0
  271. package/types/pc/verification-code/VerificationCode.d.ts +1 -1
  272. package/types/pc/verification-code/interface.d.ts +0 -2
  273. package/types/pc/virtual-list/VirtualList.d.ts +2 -38
  274. package/types/pc/virtual-list/index.d.ts +2 -1
  275. package/types/pc/virtual-list/interface.d.ts +56 -0
  276. package/types/pc/watermark/Watermark.d.ts +1 -1
  277. package/types/pc/watermark/interface.d.ts +0 -2
  278. package/typography/Base.js +73 -73
  279. package/typography/EditContent.js +43 -33
  280. package/typography/Ellipsis.js +117 -184
  281. package/typography/Operations.js +97 -49
  282. package/typography/useCssEllipsis.js +7 -6
  283. package/utils/index.js +117 -115
  284. package/utils/names.js +4 -0
  285. package/utils/toArray.js +5 -0
  286. package/version/index.js +1 -1
  287. package/virtual-list/interface.js +1 -0
  288. package/components/common/space/toArray.js +0 -11
  289. package/loading/style/index.module.less.js +0 -4
  290. package/types/common/space/toArray.d.ts +0 -3
  291. package/types/pc/suspense-fallback-test/style/index.d.ts +0 -1
  292. /package/{suspense-fallback-test/style/index.less.js → development/interface.js} +0 -0
  293. /package/types/pc/grid/{GridItem.d.ts → Item.d.ts} +0 -0
@@ -1,58 +1,82 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import w from "@unicom-cloud/icons/IconUiMute";
3
- import y from "@unicom-cloud/icons/IconUiPauseCircleFill";
4
- import I from "@unicom-cloud/icons/IconUiPlayCircleFill";
5
- import x from "@unicom-cloud/icons/IconUiSound";
6
- import { memo as C, forwardRef as P, useState as U, useEffect as g, useImperativeHandle as b } from "react";
7
- function B(u) {
8
- function p(f, m) {
9
- const { useButton: h = !0, buttonProps: c, ...o } = f ?? {}, [s, t] = U(!1);
10
- function l() {
11
- window.speechSynthesis?.cancel?.();
1
+ import { jsx as h } from "react/jsx-runtime";
2
+ import P from "@unicom-cloud/icons/IconUiMute";
3
+ import U from "@unicom-cloud/icons/IconUiPauseCircleFill";
4
+ import b from "@unicom-cloud/icons/IconUiPlayCircleFill";
5
+ import N from "@unicom-cloud/icons/IconUiSound";
6
+ import { forwardRef as v, useState as x, useMemo as E, useCallback as c, useImperativeHandle as F, useEffect as M, memo as R } from "react";
7
+ const T = (S) => {
8
+ const d = v((g, C) => {
9
+ const { useButton: I = !0, buttonProps: f = {}, ...s } = g, [l, i] = x(!1), [a, m] = x(
10
+ null
11
+ ), e = E(
12
+ () => "speechSynthesis" in window && "SpeechSynthesisUtterance" in window,
13
+ []
14
+ ), o = c(() => {
15
+ e && (window.speechSynthesis.cancel(), i(!1), m(null));
16
+ }, [e]), p = c(() => {
17
+ if (!e) return;
18
+ o();
19
+ const n = s.getText?.() ?? s.text;
20
+ if (!n) return;
21
+ const t = new SpeechSynthesisUtterance(n);
22
+ m(t);
23
+ const r = () => {
24
+ i(!1), m(null);
25
+ };
26
+ t.onstart = () => i(!0), t.onend = r, t.onerror = r, t.onpause = () => i(!1), t.onresume = () => i(!0);
27
+ try {
28
+ window.speechSynthesis.speak(t);
29
+ } catch (y) {
30
+ console.error("Speech synthesis failed:", y), r();
31
+ }
32
+ }, [o, e, s.getText, s.text]), u = c(() => {
33
+ e && a && window.speechSynthesis.pause();
34
+ }, [e, a]), w = c(() => {
35
+ e && a && window.speechSynthesis.resume();
36
+ }, [e, a]), k = c(
37
+ (n) => {
38
+ n.preventDefault(), n.stopPropagation(), l ? u() : p(), f.onClick?.(n);
39
+ },
40
+ [l, u, p, f.onClick]
41
+ );
42
+ if (F(
43
+ C,
44
+ () => ({
45
+ cancel: o,
46
+ speak: p,
47
+ pause: u,
48
+ resume: w
49
+ }),
50
+ [o, p, u, w]
51
+ ), M(() => o, [o]), !e)
52
+ return null;
53
+ if (I) {
54
+ const { label: n, text: t, children: r, ...y } = f;
55
+ return /* @__PURE__ */ h(
56
+ S,
57
+ {
58
+ ...s,
59
+ type: "text",
60
+ size: "mini",
61
+ icon: l ? /* @__PURE__ */ h(P, {}) : /* @__PURE__ */ h(N, {}),
62
+ ...y,
63
+ onClick: k,
64
+ children: n || t || r
65
+ }
66
+ );
12
67
  }
13
- function S() {
14
- let n = o.getText?.() || o.text, e = new SpeechSynthesisUtterance(n);
15
- e.onstart = function() {
16
- t(!0);
17
- }, e.onerror = () => {
18
- t(!1);
19
- }, e.onmark = () => {
20
- }, e.onpause = () => {
21
- t(!1);
22
- }, e.onresume = () => {
23
- t(!0);
24
- }, e.onboundary = () => {
25
- }, e.onend = () => {
26
- t(!1);
27
- }, window.speechSynthesis?.speak?.(e);
28
- }
29
- function a(n) {
30
- l(), s || S(), c?.onClick?.(n);
31
- }
32
- let r;
33
- if (window.speechSynthesis && window.SpeechSynthesisUtterance)
34
- if (h) {
35
- let { label: n, text: e, children: d, ...k } = c ?? {};
36
- r = /* @__PURE__ */ i(
37
- u,
38
- {
39
- ...o,
40
- type: "text",
41
- size: "mini",
42
- icon: s ? /* @__PURE__ */ i(w, {}) : /* @__PURE__ */ i(x, {}),
43
- ...k,
44
- onClick: a,
45
- children: n || e || d
46
- }
47
- );
48
- } else
49
- r = /* @__PURE__ */ i(s ? y : I, { ...o.iconProps, onClick: a });
50
- return g(() => () => {
51
- l();
52
- }, []), b(m, () => ({})), r;
53
- }
54
- return C(P(p));
55
- }
68
+ return /* @__PURE__ */ h(
69
+ l ? U : b,
70
+ {
71
+ ...s.iconProps,
72
+ onClick: k,
73
+ style: { cursor: "pointer" }
74
+ }
75
+ );
76
+ });
77
+ return d.displayName = `WithSpeechSynthesis(${S.displayName || S.name || "SpeechSynthesis"})`, R(d);
78
+ };
79
+ T.displayName = "withSpeechSynthesis";
56
80
  export {
57
- B as default
81
+ T as default
58
82
  };
@@ -1,96 +1,76 @@
1
- import { jsx as c, jsxs as L } from "react/jsx-runtime";
2
- import { UI_COMMON_PREFIX as O } from "@unicom-cloud/utils/constant/ui";
3
- import P from "lodash/isArray";
4
- import _ from "lodash/isNumber";
5
- import { forwardRef as N, Fragment as b } from "react";
6
- import k from "../hooks/useMergeProps.js";
7
- import x from "@unicom-cloud/utils/class-name";
8
- import F from "./toArray.js";
9
- const D = {
1
+ import { jsx as o, jsxs as _ } from "react/jsx-runtime";
2
+ import { UI_COMMON_PREFIX as b } from "@unicom-cloud/utils/constant/ui";
3
+ import O from "lodash/isArray";
4
+ import R from "lodash/isNumber";
5
+ import { forwardRef as f, Fragment as k } from "react";
6
+ import E from "../hooks/useMergeProps.js";
7
+ import F from "@unicom-cloud/utils/class-name";
8
+ import { toArray as L } from "../utils/toArray.js";
9
+ const u = {
10
+ mini: 4,
11
+ small: 8,
12
+ medium: 16,
13
+ large: 24
14
+ }, U = {
10
15
  size: "small",
11
16
  direction: "horizontal"
12
- };
13
- function E(a, m) {
14
- const S = k(a, D, {}), {
15
- className: z,
16
- style: C,
17
- children: M,
18
- gap: j,
19
- size: w,
20
- direction: s,
21
- align: B,
22
- alignItems: R,
23
- justifyContent: d,
24
- wrap: l,
25
- split: p,
26
- rtl: $,
27
- ...V
28
- } = S, r = `${O}-space`, h = R ?? (B || (s === "horizontal" ? "center" : "")), i = j ?? w, A = x(
29
- r,
30
- {
31
- [`${r}-${s}`]: s,
32
- [`${r}-justify-content-${d}`]: d,
33
- [`${r}-align-items-${h}`]: h,
34
- [`${r}-wrap`]: l,
35
- [`${r}-rtl`]: $
36
- },
37
- z
38
- );
39
- function f(e) {
40
- if (_(e))
41
- return e;
42
- switch (e) {
43
- case "mini":
44
- return 4;
45
- case "small":
46
- return 8;
47
- case "medium":
48
- return 16;
49
- case "large":
50
- return 24;
51
- default:
52
- return 8;
53
- }
54
- }
55
- const y = F(M);
56
- function I(e) {
57
- const n = y.length === e + 1, o = $ ? "marginLeft" : "marginRight";
58
- if (typeof i == "string" || typeof i == "number") {
59
- const t = f(i);
60
- return l ? n ? { marginBottom: t } : {
61
- [`${o}`]: t,
62
- marginBottom: t
63
- } : n ? {} : {
64
- [s === "vertical" ? "marginBottom" : o]: t
65
- };
66
- }
67
- if (P(i)) {
68
- const t = f(i[0]), u = f(i[1]);
69
- return l ? n ? { marginBottom: u } : {
70
- [`${o}`]: t,
71
- marginBottom: u
72
- } : s === "vertical" ? { marginBottom: u } : { [`${o}`]: t };
73
- }
17
+ }, d = f(
18
+ function(a, y) {
19
+ const $ = E(a, U, {}), {
20
+ className: N,
21
+ style: S,
22
+ children: h,
23
+ gap: G,
24
+ size: x,
25
+ direction: n = "horizontal",
26
+ align: P,
27
+ alignItems: V,
28
+ justifyContent: l,
29
+ wrap: j,
30
+ split: p,
31
+ rtl: w,
32
+ ...z
33
+ } = $, e = `${b}-space`, r = G ?? x, m = V ?? P ?? (n === "horizontal" ? "center" : ""), A = F(
34
+ e,
35
+ {
36
+ [`${e}-${n}`]: n,
37
+ [`${e}-justify-content-${l}`]: l,
38
+ [`${e}-align-items-${m}`]: m,
39
+ [`${e}-wrap`]: j,
40
+ [`${e}-rtl`]: w
41
+ },
42
+ N
43
+ ), i = (t) => R(t) ? t : u[t] ?? u.small, C = {
44
+ ...(() => {
45
+ if (typeof r == "string" || typeof r == "number")
46
+ return {
47
+ gap: `${i(r)}px`
48
+ };
49
+ if (O(r)) {
50
+ const t = i(r[1]), s = i(r[0]);
51
+ return {
52
+ rowGap: `${t}px`,
53
+ columnGap: `${s}px`
54
+ };
55
+ }
56
+ return {};
57
+ })(),
58
+ ...S
59
+ }, v = L(h);
60
+ return /* @__PURE__ */ o("div", { ref: y, className: A, style: C, ...z, children: v.map((t, s) => {
61
+ const I = t?.key ?? s, M = p != null && s > 0;
62
+ return /* @__PURE__ */ _(k, { children: [
63
+ M && /* @__PURE__ */ o("div", { className: `${e}-item-split`, children: p }),
64
+ /* @__PURE__ */ o("div", { className: `${e}-item`, children: t })
65
+ ] }, I);
66
+ }) });
74
67
  }
75
- return /* @__PURE__ */ c("div", { ref: m, className: A, style: C, ...V, children: y.map((e, n) => {
76
- const o = e?.key || n, t = p != null && n > 0;
77
- return /* @__PURE__ */ L(b, { children: [
78
- t && /* @__PURE__ */ c("div", { className: `${r}-item-split`, children: p }),
79
- /* @__PURE__ */ c("div", { className: `${r}-item`, style: I(n), children: e })
80
- ] }, o);
81
- }) });
82
- }
83
- const g = N(
84
- E
85
- );
86
- g.displayName = "Space";
87
- function H(a, m) {
88
- return /* @__PURE__ */ c(g, { ref: m, ...a, direction: "vertical", children: a.children });
89
- }
90
- const v = N(H);
91
- v.displayName = "SpaceVertical";
92
- g.Vertical = v;
68
+ ), g = f((c, a) => /* @__PURE__ */ o(d, { ref: a, ...c, direction: "vertical" })), T = Object.assign(d, {
69
+ displayName: "Space",
70
+ Vertical: g
71
+ });
72
+ g.displayName = "Space.Vertical";
93
73
  export {
94
- v as SpaceVertical,
95
- g as default
74
+ g as SpaceVertical,
75
+ T as default
96
76
  };
@@ -0,0 +1,16 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import e from "react";
3
+ const a = (n, r) => {
4
+ const s = e.useMemo(
5
+ () => e.lazy(
6
+ () => new Promise(() => {
7
+ })
8
+ ),
9
+ []
10
+ );
11
+ return /* @__PURE__ */ o(s, {});
12
+ }, t = e.forwardRef(a);
13
+ t.displayName = "SuspenseFallbackTest";
14
+ export {
15
+ t as default
16
+ };
@@ -0,0 +1,12 @@
1
+ import o from "react";
2
+ import { isFragment as a } from "react-is";
3
+ function t(s, p = {}) {
4
+ const e = [];
5
+ return o.Children.forEach(s, (r) => {
6
+ r == null && !p.keepEmpty || (Array.isArray(r) ? e.push(...t(r, p)) : a(r) && "props" in r && r.props ? e.push(...t(r.props.children, p)) : e.push(r));
7
+ }), e;
8
+ }
9
+ export {
10
+ t as default,
11
+ t as toArray
12
+ };
package/copy/index.js CHANGED
@@ -1,62 +1,110 @@
1
- import { jsx as i, jsxs as y } from "react/jsx-runtime";
2
- import x from "@unicom-cloud/icons/IconUiCheckCircleFill";
3
- import g from "@unicom-cloud/icons/IconUiCopy";
4
- import { useContext as T, useState as h, useRef as b, useEffect as P } from "react";
1
+ import { jsx as e, jsxs as x } from "react/jsx-runtime";
2
+ import g from "@unicom-cloud/icons/IconUiCheckCircleFill";
3
+ import T from "@unicom-cloud/icons/IconUiCopy";
4
+ import { useContext as h, useState as b, useRef as P, useEffect as w } from "react";
5
5
  import "../config-provider/ConfigProvider.js";
6
- import w from "../components/common/hooks/useKeyboardEvent.js";
7
- import E from "../tooltip/index.js";
8
- import N from "@unicom-cloud/utils/class-name";
9
- import k from "@unicom-cloud/utils/clipboard-copy";
10
- import { mergedToString as v } from "../components/common/utils/mergedToString.js";
11
- import I from "../config-provider/context.js";
12
- function j(o) {
13
- const { children: r } = o, u = w(), C = T(I), { getPrefixCls: d, locale: c } = C, l = d?.("copy"), [t, s] = h(!1), e = b(-1), n = o.tooltips || [
6
+ import E from "../components/common/hooks/useKeyboardEvent.js";
7
+ import N from "../tooltip/index.js";
8
+ import "@unicom-cloud/utils/case-name";
9
+ import k from "@unicom-cloud/utils/class-name";
10
+ import "../dist/tinycolor/chunk/BOzCVdr0.js";
11
+ import "@unicom-cloud/utils/constant/ui";
12
+ import "../utils/contextHolder.js";
13
+ import "@unicom-cloud/utils/dayjs";
14
+ import I from "@unicom-cloud/utils/clipboard-copy";
15
+ import "../components/common/utils/dayjs.js";
16
+ import "../components/common/utils/dom.js";
17
+ import "@unicom-cloud/utils/file/fileToURL";
18
+ import "lodash/escapeRegExp";
19
+ import "lodash/isArray";
20
+ import "lodash/isNumber";
21
+ import "lodash/isString";
22
+ import "lodash/isFunction";
23
+ import "lodash/throttle";
24
+ import "../components/common/utils/is.js";
25
+ import "lodash/camelCase";
26
+ import "lodash/capitalize";
27
+ import "lodash/cloneDeep";
28
+ import "lodash/debounce";
29
+ import "lodash/get";
30
+ import "lodash/has";
31
+ import "lodash/kebabCase";
32
+ import "lodash/merge";
33
+ import "lodash/mergeWith";
34
+ import "lodash/set";
35
+ import "lodash/setWith";
36
+ import "lodash/snakeCase";
37
+ import "lodash/startCase";
38
+ import "lodash/uniq";
39
+ import "lodash/upperFirst";
40
+ import "@unicom-cloud/utils/math";
41
+ import { mergedToString as j } from "../components/common/utils/mergedToString.js";
42
+ import "../dist/react-transition-group/src/CSSTransition.js";
43
+ import "../dist/react-transition-group/src/ReplaceTransition.js";
44
+ import "../dist/react-transition-group/src/SwitchTransition.js";
45
+ import "../dist/react-transition-group/chunk/CPfP7aNL.js";
46
+ import "../dist/react-transition-group/src/TransitionGroup.js";
47
+ import "../components/common/utils/reactDOM.js";
48
+ import "@unicom-cloud/utils/file/saveAs";
49
+ import "@unicom-cloud/utils/screenfull";
50
+ import "@unicom-cloud/utils/constant/ui.js";
51
+ import "lodash/isPlainObject";
52
+ import "react-is";
53
+ import "@unicom-cloud/utils/tree";
54
+ import { isFunction as v } from "@unicom-cloud/utils/is";
55
+ import "uuid";
56
+ import "../dist/validate/src/index.js";
57
+ import "@unicom-cloud/utils/constant/keyboardCode";
58
+ import F from "../config-provider/context.js";
59
+ function S(o) {
60
+ const { children: n } = o, u = E(), C = h(F), { getPrefixCls: d, locale: c, rtl: y } = C, r = d?.("copy"), [i, l] = b(!1), m = P(-1), p = o.tooltips || [
14
61
  c?.Typography?.copy,
15
62
  c?.Typography?.copied
16
63
  ];
17
- let m = null;
18
- o.icon !== null && o.icon !== !1 && (m = t ? /* @__PURE__ */ i(x, {}) : o.icon || /* @__PURE__ */ i(g, {}));
19
- function a(f) {
20
- if (f.stopPropagation(), t)
64
+ let s = null;
65
+ o.icon !== null && o.icon !== !1 && (s = i ? /* @__PURE__ */ e(g, {}) : o.icon || /* @__PURE__ */ e(T, {}));
66
+ function f(a) {
67
+ if (a.stopPropagation(), i)
21
68
  return;
22
- const p = o.text !== void 0 ? o.text : v(r);
23
- k(p), s(!0), o.onCopy?.(p, f), e.current = window.setTimeout(() => {
24
- s(!1);
69
+ let t = o.text;
70
+ v(t) && (t = t()), t || (t = j(n)), I(t), l(!0), o.onCopy?.(t, a), m.current = window.setTimeout(() => {
71
+ l(!1);
25
72
  }, 3e3);
26
73
  }
27
- return P(() => () => {
28
- clearTimeout(e.current), e.current = -1;
29
- }, []), /* @__PURE__ */ i(
30
- E,
74
+ return w(() => () => {
75
+ clearTimeout(m.current), m.current = -1;
76
+ }, []), /* @__PURE__ */ e(
77
+ N,
31
78
  {
32
- content: t ? n[1] : n[0],
79
+ content: i ? p[1] : p[0],
33
80
  getPopupContainer: () => window.document.body,
34
81
  ...o.tooltipProps,
35
- children: /* @__PURE__ */ y(
82
+ children: /* @__PURE__ */ x(
36
83
  "span",
37
84
  {
38
- className: N(
39
- `${l}-copy`,
40
- !!t && `${l}-copied`,
85
+ className: k(
86
+ r,
87
+ !!y && `${r}-rtl`,
88
+ !!i && `${r}-copied`,
41
89
  o.className
42
90
  ),
43
91
  role: "button",
44
- "aria-label": n[0],
92
+ "aria-label": p[0],
45
93
  tabIndex: 0,
46
- onClick: a,
94
+ onClick: f,
47
95
  ...u({
48
- onPressEnter: a
96
+ onPressEnter: f
49
97
  }),
50
98
  children: [
51
- r,
52
- m
99
+ n,
100
+ s
53
101
  ]
54
102
  }
55
103
  )
56
104
  }
57
105
  );
58
106
  }
59
- j.displayName = "Copy";
107
+ S.displayName = "Copy";
60
108
  export {
61
- j as default
109
+ S as default
62
110
  };