@unicom-cloud/ui 0.8.100 → 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 (188) hide show
  1. package/Details.js +13 -2
  2. package/Divider.js +3 -2
  3. package/Flex.js +14 -4
  4. package/Loading.js +16 -3
  5. package/Space.js +3 -3
  6. package/Splitter.js +4 -3
  7. package/SuspenseFallbackTest.js +2 -4
  8. package/alert/index.js +60 -62
  9. package/back-top/index.js +32 -33
  10. package/calendar/index.js +85 -84
  11. package/components/common/development/index.js +44 -29
  12. package/components/common/empty/index.js +35 -23
  13. package/components/common/flex/index.js +64 -0
  14. package/components/common/flex/interface.js +9 -0
  15. package/components/common/higher-order/with-speech-synthesis/index.js +79 -55
  16. package/components/common/space/index.js +71 -91
  17. package/components/common/suspense-fallback-test/index.js +16 -0
  18. package/components/common/utils/toArray.js +12 -0
  19. package/details/index.js +102 -62
  20. package/divider/index.js +27 -21
  21. package/empty/index.js +13 -13
  22. package/flex/index.js +43 -55
  23. package/flex/interface.js +1 -34
  24. package/icon/interface.js +1 -0
  25. package/icon-hover/interface.js +1 -0
  26. package/index.js +537 -536
  27. package/loading/index.js +72 -53
  28. package/loading/interface.js +1 -0
  29. package/modal/Modal.js +73 -74
  30. package/package.json +1 -1
  31. package/portal/interface.js +1 -0
  32. package/segmented/index.js +47 -47
  33. package/space/index.js +41 -35
  34. package/speech-synthesis/interface.js +1 -0
  35. package/splitter/Splitter.js +85 -89
  36. package/splitter/hooks/useItems.js +1 -1
  37. package/splitter/index.js +5 -4
  38. package/style.css +1 -1
  39. package/suspense-fallback-test/index.js +2 -11
  40. package/suspense-fallback-test/interface.js +1 -0
  41. package/table/Table.js +38 -38
  42. package/trigger/index.js +67 -70
  43. package/types/common/development/index.d.ts +7 -1
  44. package/types/common/development/interface.d.ts +22 -0
  45. package/types/common/empty/index.d.ts +2 -1
  46. package/types/common/flex/index.d.ts +14 -0
  47. package/types/common/flex/interface.d.ts +62 -0
  48. package/types/common/higher-order/with-speech-synthesis/index.d.ts +6 -1
  49. package/types/common/higher-order/with-speech-synthesis/interface.d.ts +13 -0
  50. package/types/common/space/index.d.ts +4 -4
  51. package/types/common/space/interface.d.ts +10 -18
  52. package/types/common/suspense-fallback-test/index.d.ts +7 -0
  53. package/types/common/suspense-fallback-test/interface.d.ts +1 -0
  54. package/types/common/utils/PqbCSSTransition.d.ts +1 -1
  55. package/types/common/utils/toArray.d.ts +13 -0
  56. package/types/pc/alert/index.d.ts +2 -1
  57. package/types/pc/alert/interface.d.ts +7 -1
  58. package/types/pc/badge/Count.d.ts +1 -1
  59. package/types/pc/breadcrumb/Item.d.ts +1 -1
  60. package/types/pc/calendar/Month.d.ts +1 -1
  61. package/types/pc/calendar/WeekList.d.ts +1 -1
  62. package/types/pc/calendar/Year.d.ts +1 -1
  63. package/types/pc/calendar/header/Panel.d.ts +1 -1
  64. package/types/pc/calendar/header/index.d.ts +1 -1
  65. package/types/pc/calendar/index.d.ts +1 -1
  66. package/types/pc/calendar/interface.d.ts +2 -1
  67. package/types/pc/cascader/interface.d.ts +1 -1
  68. package/types/pc/cascader/panel/List.d.ts +1 -1
  69. package/types/pc/cascader/panel/Option.d.ts +1 -1
  70. package/types/pc/cascader/panel/Search.d.ts +1 -1
  71. package/types/pc/checkbox/Group.d.ts +2 -2
  72. package/types/pc/checkbox/GroupBlock.d.ts +1 -1
  73. package/types/pc/checkbox/IconCheck.d.ts +1 -1
  74. package/types/pc/color-picker/InputRgb.d.ts +1 -1
  75. package/types/pc/color-picker/Palette.d.ts +1 -1
  76. package/types/pc/config-provider/ConfigProvider.d.ts +1 -1
  77. package/types/pc/config-provider/interface.d.ts +4 -0
  78. package/types/pc/copy/index.d.ts +1 -1
  79. package/types/pc/date-picker/panel/Body.d.ts +1 -1
  80. package/types/pc/date-picker/panel/Footer.d.ts +1 -1
  81. package/types/pc/date-picker/panel/Header.d.ts +1 -1
  82. package/types/pc/date-picker/panel/WeekList.d.ts +1 -1
  83. package/types/pc/date-picker/panel/date/index.d.ts +1 -1
  84. package/types/pc/date-picker/panel/month/index.d.ts +1 -1
  85. package/types/pc/date-picker/panel/quarter/index.d.ts +1 -1
  86. package/types/pc/date-picker/panel/range/index.d.ts +1 -1
  87. package/types/pc/date-picker/panel/week/index.d.ts +1 -1
  88. package/types/pc/date-picker/panel/year/index.d.ts +1 -1
  89. package/types/pc/descriptions/index.d.ts +1 -1
  90. package/types/pc/details/index.d.ts +3 -2
  91. package/types/pc/details/interface.d.ts +16 -0
  92. package/types/pc/development/index.d.ts +2 -1
  93. package/types/pc/development/interface.d.ts +15 -0
  94. package/types/pc/divider/index.d.ts +7 -2
  95. package/types/pc/draggable/Item.d.ts +1 -1
  96. package/types/pc/draggable/index.d.ts +1 -1
  97. package/types/pc/flex/index.d.ts +4 -4
  98. package/types/pc/flex/interface.d.ts +8 -53
  99. package/types/pc/form/Control.d.ts +1 -1
  100. package/types/pc/form/FormList.d.ts +1 -1
  101. package/types/pc/form/IconSymbol.d.ts +1 -1
  102. package/types/pc/icon/addFromIconFontCn.d.ts +1 -7
  103. package/types/pc/icon/index.d.ts +2 -7
  104. package/types/pc/icon/interface.d.ts +13 -0
  105. package/types/pc/icon-hover/index.d.ts +2 -8
  106. package/types/pc/icon-hover/interface.d.ts +8 -0
  107. package/types/pc/image/ImageFooter.d.ts +1 -1
  108. package/types/pc/image/ImagePreviewArrow.d.ts +1 -1
  109. package/types/pc/image/TriggerForToolbar.d.ts +1 -1
  110. package/types/pc/index.d.ts +60 -51
  111. package/types/pc/loading/index.d.ts +4 -3
  112. package/types/pc/loading/interface.d.ts +6 -0
  113. package/types/pc/menu/Indent.d.ts +1 -1
  114. package/types/pc/menu/OverflowWrap.d.ts +1 -1
  115. package/types/pc/menu/sub-menu/Inline.d.ts +1 -1
  116. package/types/pc/menu/sub-menu/Pop.d.ts +1 -1
  117. package/types/pc/overflow-ellipsis/OverflowItem.d.ts +1 -1
  118. package/types/pc/overflow-ellipsis/index.d.ts +1 -1
  119. package/types/pc/pagination/PageItem.d.ts +3 -3
  120. package/types/pc/pagination/PageJumper.d.ts +1 -1
  121. package/types/pc/pagination/PageOption.d.ts +1 -1
  122. package/types/pc/portal/Portal.d.ts +2 -6
  123. package/types/pc/portal/index.d.ts +2 -9
  124. package/types/pc/portal/interface.d.ts +14 -0
  125. package/types/pc/progress/CircleProgress.d.ts +1 -1
  126. package/types/pc/progress/LineProgess.d.ts +1 -1
  127. package/types/pc/progress/StepProgress.d.ts +1 -1
  128. package/types/pc/radio/Group.d.ts +2 -2
  129. package/types/pc/radio/GroupBlock.d.ts +1 -1
  130. package/types/pc/radio/Radio.d.ts +1 -1
  131. package/types/pc/resize-box/ResizeTrigger.d.ts +1 -1
  132. package/types/pc/result/403.d.ts +1 -1
  133. package/types/pc/result/404.d.ts +1 -1
  134. package/types/pc/result/500.d.ts +1 -1
  135. package/types/pc/segmented/interface.d.ts +6 -6
  136. package/types/pc/skeleton/Image.d.ts +1 -1
  137. package/types/pc/skeleton/Text.d.ts +2 -1
  138. package/types/pc/slider/Button.d.ts +1 -1
  139. package/types/pc/slider/Input.d.ts +1 -1
  140. package/types/pc/slider/Tick.d.ts +1 -1
  141. package/types/pc/space/index.d.ts +6 -5
  142. package/types/pc/speech-synthesis/index.d.ts +3 -1
  143. package/types/pc/speech-synthesis/interface.d.ts +7 -0
  144. package/types/pc/spin/DotLoading.d.ts +1 -1
  145. package/types/pc/splitter/index.d.ts +5 -4
  146. package/types/pc/splitter/interface.d.ts +16 -16
  147. package/types/pc/suspense-fallback-test/index.d.ts +2 -3
  148. package/types/pc/suspense-fallback-test/interface.d.ts +2 -0
  149. package/types/pc/table/ColGroup.d.ts +1 -1
  150. package/types/pc/table/summary/Cell.d.ts +1 -1
  151. package/types/pc/table/summary/Row.d.ts +1 -1
  152. package/types/pc/table/tbody/Td.d.ts +1 -1
  153. package/types/pc/table/tbody/index.d.ts +1 -1
  154. package/types/pc/table/tfoot/index.d.ts +1 -1
  155. package/types/pc/table/th-resizable/index.d.ts +1 -1
  156. package/types/pc/table/thead/Column.d.ts +1 -1
  157. package/types/pc/table/thead/index.d.ts +1 -1
  158. package/types/pc/tabs/TabContent.d.ts +1 -1
  159. package/types/pc/tabs/tab-header/DropdownIcon.d.ts +1 -1
  160. package/types/pc/tabs/tab-header/TabInk.d.ts +1 -1
  161. package/types/pc/tabs/tab-header/TabNavIcon.d.ts +1 -1
  162. package/types/pc/time-picker/Picker.d.ts +1 -1
  163. package/types/pc/time-picker/RangePicker.d.ts +1 -1
  164. package/types/pc/time-picker/TimeColumn.d.ts +1 -1
  165. package/types/pc/time-picker/TimePicker.d.ts +1 -1
  166. package/types/pc/time-picker/index.d.ts +1 -1
  167. package/types/pc/transfer/Item.d.ts +1 -1
  168. package/types/pc/transfer/List.d.ts +1 -1
  169. package/types/pc/tree/Animation.d.ts +1 -1
  170. package/types/pc/typography/Operations.d.ts +1 -1
  171. package/types/pc/upload/list/index.d.ts +1 -1
  172. package/types/pc/utils/toArray.d.ts +1 -5
  173. package/types/pc/verification-code/VerificationCode.d.ts +1 -1
  174. package/types/pc/virtual-list/VirtualList.d.ts +2 -38
  175. package/types/pc/virtual-list/index.d.ts +2 -1
  176. package/types/pc/virtual-list/interface.d.ts +56 -0
  177. package/types/pc/watermark/Watermark.d.ts +1 -1
  178. package/utils/index.js +1 -1
  179. package/utils/toArray.js +3 -10
  180. package/version/index.js +1 -1
  181. package/virtual-list/interface.js +1 -0
  182. package/components/common/space/toArray.js +0 -11
  183. package/flex/utils.js +0 -13
  184. package/loading/style/index.module.less.js +0 -4
  185. package/types/common/space/toArray.d.ts +0 -3
  186. package/types/pc/flex/utils.d.ts +0 -9
  187. package/types/pc/suspense-fallback-test/style/index.d.ts +0 -1
  188. /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
+ };
@@ -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
+ };