@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
@@ -1,32 +1,47 @@
1
- import { jsxs as r, jsx as l } from "react/jsx-runtime";
2
- import n from "@unicom-cloud/icons/IconFluentFlatHourglassNotDone";
3
- import a from "@unicom-cloud/utils/class-name";
4
- import { UI_COMMON_PREFIX as o } from "@unicom-cloud/utils/constant/ui";
5
- import s from "lodash/uniqBy";
6
- import c from "lodash/uniqWith";
7
- import { forwardRef as f, useEffect as u, useImperativeHandle as x } from "react";
8
- function N(e, i) {
9
- c([], (t) => t.xxx), s([{ x: 1 }, { x: 2 }, { x: 1 }], "x");
10
- const m = `${o}-development`;
11
- return u(() => () => {
12
- }, []), x(i, () => ({})), /* @__PURE__ */ r("div", { className: a(m, e.className), children: [
13
- e.url ? /* @__PURE__ */ l(
14
- "img",
15
- {
16
- className: a(`${m}-img`, e.imgClassName),
17
- src: e.url
18
- },
19
- "img"
20
- ) : e.icon ?? /* @__PURE__ */ l(
21
- n,
22
- {
23
- className: a(`${m}-icon`, e.iconClassName)
24
- }
25
- ),
26
- /* @__PURE__ */ l("div", { className: a(`${m}-label`, e.labelClassName), children: e.tip ?? e.label ?? "等待开发" })
1
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
2
+ import C from "@unicom-cloud/icons/IconFluentFlatHourglassNotDone";
3
+ import s from "@unicom-cloud/utils/class-name";
4
+ import { UI_COMMON_PREFIX as v } from "@unicom-cloud/utils/constant/ui";
5
+ import { forwardRef as x, useMemo as b } from "react";
6
+ const g = (t, n) => {
7
+ const {
8
+ url: a,
9
+ // 图片地址
10
+ imgClassName: o,
11
+ // 图片自定义类名
12
+ icon: m,
13
+ // 自定义图标
14
+ iconClassName: r,
15
+ // 图标自定义类名
16
+ tip: c,
17
+ // 高优先级提示文字
18
+ label: i = "等待开发",
19
+ // 次要提示文字(默认值)
20
+ labelClassName: p,
21
+ // 文字容器类名
22
+ className: N
23
+ // 外层容器类名
24
+ } = t, e = `${v}-development`, d = b(() => a ? /* @__PURE__ */ l(
25
+ "img",
26
+ {
27
+ className: s(`${e}-img`, o),
28
+ src: a,
29
+ alt: "开发预览图"
30
+ }
31
+ ) : m ?? /* @__PURE__ */ l(
32
+ C,
33
+ {
34
+ className: s(`${e}-icon`, r)
35
+ }
36
+ ), [a, e, o, m, r]), f = c ?? i;
37
+ return /* @__PURE__ */ u("div", { ref: n, className: s(e, N), children: [
38
+ d,
39
+ /* @__PURE__ */ l("div", { className: s(`${e}-label`, p), children: f })
27
40
  ] });
28
- }
29
- const h = f(N);
41
+ }, D = x(
42
+ g
43
+ );
44
+ D.displayName = "Development";
30
45
  export {
31
- h as default
46
+ D as default
32
47
  };
@@ -1,37 +1,49 @@
1
- import { jsxs as N, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as N, jsx as s } from "react/jsx-runtime";
2
2
  import $ from "@unicom-cloud/icons/IconUiEmpty";
3
- import { UI_COMMON_PREFIX as y } from "@unicom-cloud/utils/constant/ui";
4
- import { memo as g, forwardRef as x } from "react";
5
- import { SpaceVertical as u } from "../space/index.js";
6
- import s from "@unicom-cloud/utils/class-name";
7
- function C(c, n) {
8
- const { style: a, className: p, description: m, icon: o, imgSrc: r, prefixCls: l, ...f } = c, e = `${y}-empty`, i = l ?? e, d = typeof m == "string" ? m : "empty";
3
+ import { UI_COMMON_PREFIX as g } from "@unicom-cloud/utils/constant/ui";
4
+ import { memo as x, forwardRef as u } from "react";
5
+ import { SpaceVertical as C } from "../space/index.js";
6
+ import r from "@unicom-cloud/utils/class-name";
7
+ const E = (n, c) => {
8
+ const {
9
+ style: a,
10
+ className: p,
11
+ description: i = "无数据",
12
+ // 默认描述文本
13
+ icon: o,
14
+ imgSrc: m,
15
+ prefixCls: l,
16
+ ...f
17
+ } = n, e = `${g}-empty`, t = l ?? e, d = typeof i == "string" ? i : "empty", y = () => m ? /* @__PURE__ */ s(
18
+ "img",
19
+ {
20
+ className: r(`${e}-img`, `${t}-img`),
21
+ alt: d,
22
+ src: m,
23
+ loading: "lazy"
24
+ }
25
+ ) : o ? /* @__PURE__ */ s("div", { className: r(`${e}-icon`, `${t}-icon`), children: o }) : /* @__PURE__ */ s($, { className: r(`${e}-icon`, `${t}-icon`) });
9
26
  return /* @__PURE__ */ N(
10
- u,
27
+ C,
11
28
  {
12
- ref: n,
13
- className: s(e, i, p),
29
+ ref: c,
30
+ className: r(e, t, p),
14
31
  style: a,
15
32
  justifyContent: "center",
16
33
  alignItems: "center",
17
34
  gap: 5,
18
35
  ...f,
19
36
  children: [
20
- r ? /* @__PURE__ */ t(
21
- "img",
22
- {
23
- className: s(`${e}-img`, `${i}-img`),
24
- alt: d,
25
- src: r
26
- }
27
- ) : o ? /* @__PURE__ */ t("div", { className: s(`${e}-icon`, `${i}-icon`), children: o }) : /* @__PURE__ */ t($, { className: s(`${e}-icon`, `${i}-icon`) }),
28
- /* @__PURE__ */ t("div", { className: s(`${e}-description`, `${i}-description`), children: m || "无数据" })
37
+ y(),
38
+ /* @__PURE__ */ s("div", { className: r(`${e}-description`, `${t}-description`), children: i })
29
39
  ]
30
40
  }
31
41
  );
32
- }
33
- const E = g(x(C));
34
- E.displayName = "Empty";
42
+ }, I = x(
43
+ u(E)
44
+ );
45
+ I.displayName = "Empty";
35
46
  export {
36
- E as default
47
+ I as Empty,
48
+ I as default
37
49
  };
@@ -0,0 +1,64 @@
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import { UI_COMMON_PREFIX as j } from "@unicom-cloud/utils/constant/ui";
3
+ import { forwardRef as x, useMemo as C } from "react";
4
+ import I from "../hooks/useMergeProps.js";
5
+ import P from "@unicom-cloud/utils/class-name";
6
+ import "../utils/is.js";
7
+ import { GAP_SIZE_MAP as y } from "./interface.js";
8
+ import { isBoolean as V, isArray as _, isString as A } from "@unicom-cloud/utils/is";
9
+ const O = (o) => A(o) && Object.keys(y).includes(o), m = (o, r, t) => {
10
+ t !== void 0 && (O(t) ? o[r] = y[t] : o[r] = typeof t == "number" ? `${t}px` : t);
11
+ }, S = (o = {}, r, t = "gap") => (r === void 0 || (_(r) ? (m(o, "rowGap", r[0]), m(o, "columnGap", r[1])) : m(o, t, r)), o), b = {
12
+ component: "div",
13
+ gap: "small"
14
+ }, a = x((o, r) => {
15
+ const t = I(o, b, {}), {
16
+ className: g,
17
+ style: c,
18
+ flex: l,
19
+ gap: f,
20
+ children: u,
21
+ direction: e,
22
+ justify: i,
23
+ align: n,
24
+ component: N = "div",
25
+ wrap: s,
26
+ rtl: w,
27
+ ...F
28
+ } = t, p = `${j}-flex`, G = C(() => {
29
+ const M = {
30
+ display: "flex",
31
+ ...S({}, f),
32
+ ...s !== void 0 && {
33
+ flexWrap: V(s) ? s ? "wrap" : "nowrap" : s
34
+ },
35
+ ...n && { alignItems: n },
36
+ ...i && { justifyContent: i },
37
+ ...e && { flexDirection: e },
38
+ ...l && { flex: l }
39
+ };
40
+ return { ...c, ...M };
41
+ }, [f, s, n, i, e, l, c]);
42
+ return /* @__PURE__ */ d(
43
+ N,
44
+ {
45
+ ref: r,
46
+ style: G,
47
+ className: P(p, g, {
48
+ [`${p}-rtl`]: w,
49
+ [`${p}-${e}`]: e,
50
+ [`${p}-${i}`]: i,
51
+ [`${p}-${n}`]: n
52
+ }),
53
+ ...F,
54
+ children: u
55
+ }
56
+ );
57
+ }), $ = x((o, r) => /* @__PURE__ */ d(a, { ref: r, ...o, direction: "column" }));
58
+ a.Vertical = $;
59
+ a.displayName = "Flex";
60
+ $.displayName = "Flex.Vertical";
61
+ export {
62
+ $ as FlexVertical,
63
+ a as default
64
+ };
@@ -0,0 +1,9 @@
1
+ const p = {
2
+ mini: "4px",
3
+ small: "8px",
4
+ medium: "12px",
5
+ large: "20px"
6
+ };
7
+ export {
8
+ p as GAP_SIZE_MAP
9
+ };
@@ -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
+ };
@@ -9,7 +9,7 @@ import { supportRef as E } from "./is.js";
9
9
  import { findDOMNode_ as R, callbackOriginRef as x } from "./reactDOM.js";
10
10
  function j(n) {
11
11
  const { children: e, ...i } = n, o = f(), t = f(), m = l(() => n.nodeRef === void 0 && E(e) && a(e) ? (t.current = !0, s(e, {
12
- ref: (r) => {
12
+ ref(r) {
13
13
  o.current = R(r), x(e, r);
14
14
  }
15
15
  })) : (t.current = !1, e), [e, n.nodeRef]);
@@ -1,6 +1,9 @@
1
- const n = window.document.documentElement, o = () => {
1
+ import { UI_PC_KEY as e, UI_PC_THEME_DARK_CLASS_NAME as n } from "@unicom-cloud/utils/constant/ui";
2
+ const E = window.document.documentElement, _ = () => {
2
3
  };
3
4
  export {
4
- n as CSS_VARIABLE_ELEMENT,
5
- o as NOOP
5
+ E as CSS_VARIABLE_ELEMENT,
6
+ _ as NOOP,
7
+ e as UI_PC_KEY,
8
+ n as UI_PC_THEME_DARK_CLASS_NAME
6
9
  };
@@ -18,10 +18,12 @@ function p(t) {
18
18
  const i = !!e?.has(o);
19
19
  return e?.add(o), i;
20
20
  }
21
- const N = (t, o) => {
21
+ const m = (t, o) => {
22
22
  if (t) {
23
23
  if (t instanceof Element)
24
24
  return t;
25
+ if (t?.dom instanceof Element)
26
+ return t.dom;
25
27
  if (t.current instanceof Element)
26
28
  return t.current;
27
29
  if (f(t.getRootDOMNode))
@@ -34,13 +36,13 @@ const N = (t, o) => {
34
36
  "Element does not define the `getRootDOMNode` method causing a call to React.findDOMNode. but findDOMNode is deprecated in StrictMode. Please check the code logic",
35
37
  { element: t, instance: o }
36
38
  ), r) ? r(o) : null;
37
- }, m = (t, o) => {
39
+ }, N = (t, o) => {
38
40
  t && t.ref && (f(t.ref) && t?.ref(o), "current" in t.ref && (t.ref.current = o));
39
41
  }, k = (t) => {
40
42
  n = t;
41
43
  };
42
44
  export {
43
- m as callbackOriginRef,
44
- N as findDOMNode_,
45
+ N as callbackOriginRef,
46
+ m as findDOMNode_,
45
47
  k as setCreateRoot
46
48
  };
@@ -21,5 +21,5 @@ function u(e, t) {
21
21
  export {
22
22
  u as default,
23
23
  u as scrollIntoView,
24
- u as scrollIntoViewIfNeeded
24
+ a as scrollIntoViewIfNeeded
25
25
  };
@@ -1,30 +1,30 @@
1
- import { a as o } from "../../../dist/tinycolor/chunk/BOzCVdr0.js";
2
- import { TinyColor as y } from "../../../dist/tinycolor/src/index.js";
3
- import { UI_PC_PREFIX as c } from "@unicom-cloud/utils/constant/ui";
4
- import { CSS_VARIABLE_ELEMENT as E } from "./constant.js";
5
- function v(l) {
1
+ import { UI_PC_PREFIX as y } from "@unicom-cloud/utils/constant/ui";
2
+ import c from "@unicom-cloud/utils/tinycolor";
3
+ import * as o from "@unicom-cloud/utils/ui-color";
4
+ import { CSS_VARIABLE_ELEMENT as u } from "./constant.js";
5
+ function g(s) {
6
6
  const {
7
7
  color: e,
8
- element: a = E,
8
+ element: t = u,
9
9
  isDark: f = !1,
10
- prefix: t = c
11
- } = l ?? {}, i = {
10
+ prefix: a = y
11
+ } = s ?? {}, i = {
12
12
  color: e
13
13
  }, m = f ? o.generateDark(i) : o.generate(i);
14
- new y(e).equals(o.primary.value) ? n() : m.forEach((s, r, p) => {
15
- a.style.setProperty(
16
- `--${t}-primary-${r + 1}`,
17
- s.toRgbArrayString()
14
+ new c(e).equals(o.primary.value) ? l() : m.forEach((n, r, p) => {
15
+ t.style.setProperty(
16
+ `--${a}-primary-${r + 1}`,
17
+ n.toRgbArrayString()
18
18
  );
19
19
  });
20
- function n() {
21
- m.forEach((s, r, p) => {
22
- a.style.removeProperty(`--${t}-primary-${r + 1}`);
20
+ function l() {
21
+ m.forEach((n, r, p) => {
22
+ t.style.removeProperty(`--${a}-primary-${r + 1}`);
23
23
  });
24
24
  }
25
- return n;
25
+ return l;
26
26
  }
27
27
  export {
28
- v as default,
29
- v as setPrimaryColor
28
+ g as default,
29
+ g as setPrimaryColor
30
30
  };