@unicom-cloud/ui 0.8.96 → 0.8.98

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 (302) hide show
  1. package/Affix.js +1 -1
  2. package/Carousel.js +1 -1
  3. package/LiquidFill.js +4 -0
  4. package/OverflowEllipsis.js +1 -1
  5. package/PageHeader.js +1 -1
  6. package/QrCode.js +57 -0
  7. package/Tour.js +63 -0
  8. package/Trigger.js +1 -1
  9. package/_virtual/_commonjsHelpers.js +6 -0
  10. package/_virtual/index.js +7 -0
  11. package/_virtual/index2.js +4 -0
  12. package/affix/index.js +70 -72
  13. package/alert/index.js +56 -56
  14. package/anchor/Anchor.js +55 -55
  15. package/anchor/Link.js +34 -34
  16. package/anchor/util.js +5 -5
  17. package/auto-complete/index.js +116 -122
  18. package/avatar/Avatar.js +33 -33
  19. package/avatar/Group.js +26 -26
  20. package/back-top/index.js +58 -61
  21. package/badge/index.js +46 -46
  22. package/breadcrumb/Item.js +42 -43
  23. package/breadcrumb/index.js +47 -47
  24. package/button/Group.js +6 -6
  25. package/button/index.js +91 -91
  26. package/calendar/Month.js +75 -75
  27. package/calendar/Year.js +35 -35
  28. package/calendar/header/index.js +25 -25
  29. package/calendar/index.js +103 -103
  30. package/card/Grid.js +8 -8
  31. package/card/Meta.js +16 -16
  32. package/card/index.js +49 -49
  33. package/carousel/Arrow.js +19 -19
  34. package/carousel/Indicator.js +26 -26
  35. package/carousel/index.js +108 -108
  36. package/cascader/Cascader.js +178 -191
  37. package/cascader/base/node.js +133 -136
  38. package/cascader/base/store.js +82 -85
  39. package/cascader/panel/List.js +125 -129
  40. package/cascader/panel/Search.js +79 -81
  41. package/cascader/util.js +13 -13
  42. package/checkbox/Checkbox.js +94 -96
  43. package/checkbox/Group.js +54 -56
  44. package/checkbox/GroupBlock.js +28 -29
  45. package/collapse/Collapse.js +45 -45
  46. package/collapse/Item.js +53 -55
  47. package/color-picker/ControlBar.js +43 -43
  48. package/color-picker/InputAlpha.js +12 -12
  49. package/color-picker/InputHex.js +30 -31
  50. package/color-picker/InputRgb.js +24 -24
  51. package/color-picker/Palette.js +18 -18
  52. package/color-picker/Panel.js +122 -125
  53. package/color-picker/hooks/useColorPicker.js +85 -88
  54. package/color-picker/hooks/useControlBlock.js +38 -40
  55. package/color-picker/index.js +47 -47
  56. package/comment/index.js +29 -29
  57. package/components/common/higher-order/with-speech-synthesis/index.js +37 -40
  58. package/components/common/hooks/useId.js +8 -8
  59. package/components/common/hooks/useInView.js +16 -16
  60. package/components/common/hooks/useIntersectionObserver.js +1 -1
  61. package/components/common/hooks/useKeyboardEvent.js +9 -10
  62. package/components/common/hooks/useOverflowHidden.js +1 -4
  63. package/components/common/hooks/usePersistCallback.js +7 -7
  64. package/components/common/hooks/useStateCallback.js +9 -10
  65. package/components/common/hooks/useWindowSize.js +8 -8
  66. package/components/common/space/index.js +9 -7
  67. package/components/common/utils/convertToDurationBasedOnTimeUnits.js +6 -0
  68. package/components/common/utils/dom.js +27 -29
  69. package/components/common/utils/findScrollParent.js +17 -0
  70. package/components/common/utils/intersectionObserver.js +21 -0
  71. package/components/common/utils/is.js +99 -109
  72. package/components/common/utils/mutationObserver.js +19 -0
  73. package/components/common/utils/reactDOM.js +34 -34
  74. package/components/common/utils/resizeObserver.js +21 -0
  75. package/copy/index.js +38 -40
  76. package/date-picker/Picker.js +290 -295
  77. package/date-picker/RangePicker.js +367 -372
  78. package/date-picker/index.js +33 -35
  79. package/date-picker/panel/Body.js +46 -47
  80. package/date-picker/panel/Header.js +33 -33
  81. package/date-picker/panel/Shortcut.js +31 -31
  82. package/date-picker/panel/date/index.js +85 -85
  83. package/date-picker/panel/month/index.js +59 -59
  84. package/date-picker/panel/quarter/index.js +67 -70
  85. package/date-picker/panel/range/index.js +101 -101
  86. package/date-picker/panel/year/index.js +39 -39
  87. package/date-picker/util.js +17 -18
  88. package/descriptions/index.js +62 -62
  89. package/details/index.js +53 -55
  90. package/development/index.js +9 -9
  91. package/dist/tinycolor/chunk/BOzCVdr0.js +1 -1
  92. package/dist/validate/src/index.js +5 -5
  93. package/dist/validate/src/util.js +1 -1
  94. package/divider/index.js +21 -21
  95. package/draggable/Item.js +35 -35
  96. package/draggable/index.js +22 -22
  97. package/drawer/Drawer.js +142 -147
  98. package/dropdown/Button.js +48 -48
  99. package/dropdown/index.js +88 -92
  100. package/empty/index.js +16 -16
  101. package/form/Control.js +211 -225
  102. package/form/Form.js +109 -113
  103. package/form/FormItem.js +118 -120
  104. package/form/FormList.js +60 -66
  105. package/form/FormProvider.js +31 -34
  106. package/form/hook/useContext.js +17 -19
  107. package/form/hook/useState.js +22 -23
  108. package/form/hook/useWatch.js +26 -27
  109. package/form/promisify.js +14 -18
  110. package/form/store.js +304 -316
  111. package/form/util.js +14 -15
  112. package/grid/Col.js +64 -64
  113. package/grid/Grid.js +51 -51
  114. package/grid/GridItem.js +48 -48
  115. package/grid/Row.js +39 -39
  116. package/hooks/useVerificationCode.js +41 -43
  117. package/hooks/useWatermark.js +89 -92
  118. package/icon/index.js +23 -24
  119. package/icon-hover/index.js +16 -16
  120. package/icons/file.js +11 -11
  121. package/image/Image.js +140 -141
  122. package/image/ImagePreview.js +252 -255
  123. package/image/ImagePreviewArrow.js +25 -25
  124. package/image/ImagePreviewGroup.js +62 -62
  125. package/image/util/getScale.js +25 -28
  126. package/index.js +684 -675
  127. package/input/Button.js +48 -50
  128. package/input/Group.js +9 -9
  129. package/input/Input.js +145 -154
  130. package/input/InputElement.js +108 -115
  131. package/input/Password.js +38 -38
  132. package/input/Search.js +51 -55
  133. package/input/Textarea.js +80 -81
  134. package/input/useComposition.js +23 -23
  135. package/input-number/decimal.js +59 -62
  136. package/input-number/index.js +139 -141
  137. package/input-tag/InputTag.js +222 -230
  138. package/layout/Content.js +6 -6
  139. package/layout/Footer.js +8 -8
  140. package/layout/Header.js +7 -7
  141. package/layout/Sider.js +88 -90
  142. package/layout/index.js +30 -30
  143. package/link/index.js +45 -46
  144. package/liquid-fill/LiquidFill.js +226 -0
  145. package/liquid-fill/LiquidFill2.js +3 -0
  146. package/liquid-fill/index.js +4 -0
  147. package/list/Item.js +28 -28
  148. package/list/Meta.js +12 -12
  149. package/list/index.js +146 -148
  150. package/mentions/index.js +75 -76
  151. package/menu/Item.js +58 -58
  152. package/menu/Menu.js +125 -127
  153. package/menu/OverflowWrap.js +39 -40
  154. package/menu/sub-menu/Inline.js +45 -45
  155. package/menu/util.js +26 -28
  156. package/message/index.js +96 -99
  157. package/message/useMessage.js +26 -27
  158. package/modal/Confirm.js +47 -49
  159. package/modal/Modal.js +250 -257
  160. package/modal/use-modal/Hook.js +26 -28
  161. package/modal/use-modal/index.js +46 -49
  162. package/notice/index.js +89 -90
  163. package/notification/index.js +60 -65
  164. package/notification/withNotification.js +35 -35
  165. package/overflow-ellipsis/OverflowItem.js +19 -20
  166. package/overflow-ellipsis/index.js +45 -46
  167. package/package.json +1 -1
  168. package/page-header/index.js +45 -45
  169. package/pagination/PageItem.js +87 -91
  170. package/pagination/PageJumper.js +40 -41
  171. package/pagination/PageOption.js +31 -35
  172. package/pagination/Pagination.js +162 -163
  173. package/picker/Input.js +90 -96
  174. package/picker/InputRange.js +115 -122
  175. package/popconfirm/index.js +98 -100
  176. package/popover/index.js +28 -28
  177. package/portal/Portal.js +10 -11
  178. package/progress/index.js +36 -36
  179. package/qr-code/index.js +99 -0
  180. package/qr-code/interface.js +1 -0
  181. package/radio/Group.js +48 -48
  182. package/radio/GroupBlock.js +32 -33
  183. package/radio/Radio.js +62 -64
  184. package/rate/index.js +88 -88
  185. package/resize-box/ResizeTrigger.js +39 -39
  186. package/resize-box/Split.js +92 -96
  187. package/resize-box/SplitGroup.js +116 -122
  188. package/resize-box/index.js +112 -115
  189. package/result/index.js +44 -44
  190. package/select/Option.js +53 -56
  191. package/select/Select.js +365 -381
  192. package/select/util.js +95 -99
  193. package/select-view/Core.js +159 -160
  194. package/skeleton/index.js +23 -23
  195. package/slider/Button.js +84 -92
  196. package/slider/Input.js +47 -49
  197. package/slider/Tick.js +28 -31
  198. package/slider/index.js +107 -107
  199. package/space/index.js +26 -26
  200. package/space-/index.js +51 -51
  201. package/spin/DotLoading.js +8 -8
  202. package/spin/index.js +47 -47
  203. package/statistic/Countdown.js +37 -37
  204. package/statistic/index.js +58 -58
  205. package/steps/Step.js +42 -42
  206. package/steps/index.js +54 -54
  207. package/style.css +1 -1
  208. package/switch/index.js +77 -78
  209. package/table/ColGroup.js +36 -37
  210. package/table/Table.js +447 -450
  211. package/table/hook/useExpand.js +24 -24
  212. package/table/hook/useRowSelection.js +62 -62
  213. package/table/summary/Row.js +16 -17
  214. package/table/tbody/Td.js +119 -118
  215. package/table/tbody/Tr.js +119 -121
  216. package/table/tbody/index.js +62 -63
  217. package/table/th-resizable/index.js +30 -30
  218. package/table/thead/Column.js +148 -148
  219. package/table/thead/index.js +87 -88
  220. package/tabs/Tab.js +55 -55
  221. package/tabs/TabContent.js +8 -8
  222. package/tabs/TabPane.js +15 -15
  223. package/tabs/hook/useHeaderScroll.js +36 -36
  224. package/tabs/tab-header/TabInk.js +31 -33
  225. package/tabs/tab-header/TabNavIcon.js +34 -35
  226. package/tabs/tab-header/index.js +192 -195
  227. package/tag/index.js +94 -97
  228. package/time-picker/Picker.js +167 -172
  229. package/time-picker/RangePicker.js +28 -28
  230. package/time-picker/TimePicker.js +146 -146
  231. package/timeline/Item.js +46 -46
  232. package/timeline/Timeline.js +52 -52
  233. package/tooltip/index.js +89 -95
  234. package/tour/index.js +289 -0
  235. package/transfer/Item.js +54 -54
  236. package/transfer/List.js +134 -136
  237. package/transfer/index.js +91 -91
  238. package/tree/Animation.js +49 -52
  239. package/tree/Node.js +114 -122
  240. package/tree/NodeList.js +51 -51
  241. package/tree/Tree.js +386 -393
  242. package/tree-select/List.js +71 -72
  243. package/tree-select/Select.js +135 -143
  244. package/tree-select/hook/useKeyCache.js +39 -39
  245. package/tree-select/hook/useStateValue.js +12 -12
  246. package/trigger/getPopupStyle.js +60 -61
  247. package/trigger/index.js +337 -346
  248. package/types/common/space/interface.d.ts +1 -1
  249. package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
  250. package/types/common/utils/findScrollParent.d.ts +2 -0
  251. package/types/common/utils/index.d.ts +5 -0
  252. package/types/common/utils/intersectionObserver.d.ts +2 -0
  253. package/types/common/utils/mutationObserver.d.ts +2 -0
  254. package/types/common/utils/resizeObserver.d.ts +2 -0
  255. package/types/pc/config-provider/interface.d.ts +6 -0
  256. package/types/pc/index.d.ts +3 -0
  257. package/types/pc/liquid-fill/LiquidFill.d.ts +115 -0
  258. package/types/pc/liquid-fill/LiquidFill2.d.ts +1 -0
  259. package/types/pc/liquid-fill/index.d.ts +2 -0
  260. package/types/pc/qr-code/index.d.ts +34 -0
  261. package/types/pc/qr-code/interface.d.ts +39 -0
  262. package/types/pc/table/interface.d.ts +2 -2
  263. package/types/pc/tour/index.d.ts +42 -0
  264. package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
  265. package/types/pc/utils/findScrollParent.d.ts +2 -0
  266. package/types/pc/utils/index.d.ts +5 -0
  267. package/types/pc/utils/intersectionObserver.d.ts +2 -0
  268. package/types/pc/utils/mutationObserver.d.ts +2 -0
  269. package/types/pc/utils/names.d.ts +18 -0
  270. package/types/pc/utils/resizeObserver.d.ts +2 -0
  271. package/typography/Base.js +79 -81
  272. package/typography/EditContent.js +30 -33
  273. package/typography/Ellipsis.js +77 -73
  274. package/typography/Operations.js +50 -52
  275. package/typography/Paragraph.js +7 -7
  276. package/typography/Typography.js +7 -7
  277. package/typography/useEllipsis.js +105 -106
  278. package/upload/TriggerNode.js +69 -76
  279. package/upload/Upload.js +84 -87
  280. package/upload/Uploader.js +115 -118
  281. package/upload/list/PictureItem.js +61 -71
  282. package/upload/list/TextItem.js +61 -67
  283. package/upload/list/UploadProgress.js +42 -49
  284. package/upload/list/index.js +48 -49
  285. package/upload/request_.js +37 -38
  286. package/upload/util.js +39 -39
  287. package/utils/convertToDurationBasedOnTimeUnits.js +6 -0
  288. package/utils/findScrollParent.js +4 -0
  289. package/utils/index.js +281 -278
  290. package/utils/intersectionObserver.js +4 -0
  291. package/utils/mutationObserver.js +4 -0
  292. package/utils/names.js +12 -0
  293. package/utils/resizeObserver.js +4 -0
  294. package/verification-code/VerificationCode.js +50 -51
  295. package/version/index.js +1 -1
  296. package/virtual-list/VirtualList.js +243 -244
  297. package/virtual-list/util/item.js +3 -4
  298. package/watermark/Watermark.js +27 -31
  299. package/components/common/utils/resizeObserverEffect.js +0 -23
  300. package/types/common/utils/resizeObserverEffect.d.ts +0 -2
  301. package/types/pc/utils/resizeObserverEffect.d.ts +0 -2
  302. package/utils/resizeObserverEffect.js +0 -4
package/spin/index.js CHANGED
@@ -1,70 +1,70 @@
1
- import { jsx as n, jsxs as d, Fragment as h } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as r, Fragment as u } from "react/jsx-runtime";
2
2
  import E from "@unicom-cloud/icons/IconUiLoading";
3
3
  import I from "lodash/debounce";
4
- import y, { useContext as j, useState as w, useCallback as D, useRef as F, useImperativeHandle as H, useEffect as M } from "react";
4
+ import h, { useContext as j, useState as w, useCallback as P, useRef as D, useImperativeHandle as F, useEffect as H } from "react";
5
5
  import "../config-provider/ConfigProvider.js";
6
- import U from "../components/common/hooks/useMergeProps.js";
7
- import $ from "@unicom-cloud/utils/class-name";
8
- import { isEmptyReactNode as _ } from "../components/common/utils/is.js";
9
- import q from "./DotLoading.js";
10
- import A from "../config-provider/context.js";
11
- function B(S, v) {
12
- const { getPrefixCls: l, componentConfig: r } = j(A), L = U(S, {}, r == null ? void 0 : r.Spin), {
13
- style: b,
14
- className: x,
15
- children: c,
6
+ import M from "../components/common/hooks/useMergeProps.js";
7
+ import N from "@unicom-cloud/utils/class-name";
8
+ import { isEmptyReactNode as U } from "../components/common/utils/is.js";
9
+ import _ from "./DotLoading.js";
10
+ import q from "../config-provider/context.js";
11
+ function A($, y) {
12
+ const { getPrefixCls: S, componentConfig: C } = j(q), x = M($, {}, C?.Spin), {
13
+ style: v,
14
+ className: L,
15
+ children: l,
16
16
  loading: s,
17
- size: a,
18
- icon: m,
19
- element: R,
17
+ size: t,
18
+ icon: c,
19
+ element: b,
20
20
  tip: o,
21
- dot: z,
21
+ dot: R,
22
22
  delay: i,
23
- block: C = !1,
23
+ block: z = !1,
24
24
  ...k
25
- } = L, [p, f] = w(i ? !1 : s), t = D(I(f, i), [i]), u = i ? p : s, e = l == null ? void 0 : l("spin"), g = F(null);
26
- H(v, () => ({
25
+ } = x, [d, m] = w(i ? !1 : s), a = P(I(m, i), [i]), p = i ? d : s, e = S?.("spin"), f = D(null);
26
+ F(y, () => ({
27
27
  // 潘启宝添加于 2023年10月23日 星期一 10时52分55秒 CST
28
- dom: g.current,
29
- loading: p,
30
- setLoading: f,
31
- debouncedSetLoading: t
32
- })), M(() => (i && t(s), () => {
33
- t && t.cancel();
28
+ dom: f.current,
29
+ loading: d,
30
+ setLoading: m,
31
+ debouncedSetLoading: a
32
+ })), H(() => (i && a(s), () => {
33
+ a && a.cancel();
34
34
  }), [s]);
35
- const N = /* @__PURE__ */ n("span", { className: `${e}-icon`, children: m ? y.cloneElement(m, {
36
- className: $(`${e.replace("-spin", "-icon")}-loading`),
35
+ const g = /* @__PURE__ */ n("span", { className: `${e}-icon`, children: c ? h.cloneElement(c, {
36
+ className: N(`${e.replace("-spin", "-icon")}-loading`),
37
37
  style: {
38
- fontSize: a
38
+ fontSize: t
39
39
  }
40
- }) : R || (z ? /* @__PURE__ */ n(q, { size: a }) : /* @__PURE__ */ n(E, { style: { fontSize: a } })) });
40
+ }) : b || (R ? /* @__PURE__ */ n(_, { size: t }) : /* @__PURE__ */ n(E, { style: { fontSize: t } })) });
41
41
  return /* @__PURE__ */ n(
42
42
  "div",
43
43
  {
44
- ref: g,
45
- className: $(
44
+ ref: f,
45
+ className: N(
46
46
  e,
47
47
  {
48
- [`${e}-block`]: C,
49
- [`${e}-loading`]: u,
50
- [`${e}-with-tip`]: o && !c
48
+ [`${e}-block`]: z,
49
+ [`${e}-loading`]: p,
50
+ [`${e}-with-tip`]: o && !l
51
51
  },
52
- x
52
+ L
53
53
  ),
54
- style: b,
54
+ style: v,
55
55
  ...k,
56
- children: _(c) ? /* @__PURE__ */ d(h, { children: [
57
- N,
56
+ children: U(l) ? /* @__PURE__ */ r(u, { children: [
57
+ g,
58
58
  o ? /* @__PURE__ */ n("div", { className: `${e}-tip`, children: o }) : null
59
- ] }) : /* @__PURE__ */ d(h, { children: [
60
- /* @__PURE__ */ n("div", { className: `${e}-children`, children: c }),
61
- u && /* @__PURE__ */ n(
59
+ ] }) : /* @__PURE__ */ r(u, { children: [
60
+ /* @__PURE__ */ n("div", { className: `${e}-children`, children: l }),
61
+ p && /* @__PURE__ */ n(
62
62
  "div",
63
63
  {
64
64
  className: `${e}-loading-layer`,
65
- style: { fontSize: a },
66
- children: /* @__PURE__ */ d("span", { className: `${e}-loading-layer-inner`, children: [
67
- N,
65
+ style: { fontSize: t },
66
+ children: /* @__PURE__ */ r("span", { className: `${e}-loading-layer-inner`, children: [
67
+ g,
68
68
  o ? /* @__PURE__ */ n("div", { className: `${e}-tip`, children: o }) : null
69
69
  ] })
70
70
  }
@@ -73,8 +73,8 @@ function B(S, v) {
73
73
  }
74
74
  );
75
75
  }
76
- const G = y.forwardRef(B);
77
- G.displayName = "Spin";
76
+ const B = h.forwardRef(A);
77
+ B.displayName = "Spin";
78
78
  export {
79
- G as default
79
+ B as default
80
80
  };
@@ -1,56 +1,56 @@
1
- import { jsxs as M, jsx as i } from "react/jsx-runtime";
2
- import T from "dayjs";
3
- import _ from "lodash/isFunction";
4
- import { forwardRef as E, useContext as F, useState as v, useRef as O, useEffect as b } from "react";
1
+ import { jsxs as I, jsx as a } from "react/jsx-runtime";
2
+ import M from "dayjs";
3
+ import T from "lodash/isFunction";
4
+ import { forwardRef as _, useContext as E, useState as u, useRef as O, useEffect as P } from "react";
5
5
  import "../config-provider/ConfigProvider.js";
6
- import k from "@unicom-cloud/utils/class-name";
7
- import { getDayjsValue as w, getNow as p } from "../components/common/utils/dayjs.js";
8
- import { getDateString as N } from "./util.js";
9
- import q from "../config-provider/context.js";
10
- function z(n, h) {
11
- const { getPrefixCls: a } = F(q), {
12
- className: x,
13
- style: y,
14
- title: l,
6
+ import b from "@unicom-cloud/utils/class-name";
7
+ import { getDayjsValue as d, getNow as v } from "../components/common/utils/dayjs.js";
8
+ import { getDateString as w } from "./util.js";
9
+ import k from "../config-provider/context.js";
10
+ function q(n, h) {
11
+ const { getPrefixCls: p } = E(k), {
12
+ className: N,
13
+ style: x,
14
+ title: r,
15
15
  styleValue: C,
16
- value: D,
17
- onFinish: r,
18
- renderFormat: c,
16
+ value: g,
17
+ onFinish: y,
18
+ renderFormat: i,
19
19
  format: e = "HH:mm:ss",
20
- start: S = !0
21
- } = n, o = w(D, e) || T(), $ = w(n.now, e), t = a == null ? void 0 : a("statistic"), [m, g] = v(
22
- o.diff($, "millisecond")
23
- ), [f, j] = v(
24
- N(Math.max(m, 0), e)
25
- ), s = O(null), u = () => {
20
+ start: D = !0
21
+ } = n, o = d(g, e) || M(), S = d(n.now, e), t = p?.("statistic"), [l, $] = u(
22
+ o.diff(S, "millisecond")
23
+ ), [c, j] = u(
24
+ w(Math.max(l, 0), e)
25
+ ), s = O(null), m = () => {
26
26
  clearInterval(s.current), s.current = null;
27
27
  }, V = () => {
28
28
  s.current = setInterval(() => {
29
- const H = o.diff(p()), d = o.diff(p(), "millisecond");
30
- d <= 0 && (u(), r == null || r());
31
- const I = N(Math.max(d, 0), e);
32
- j(I), g(H);
29
+ const R = o.diff(v()), f = o.diff(v(), "millisecond");
30
+ f <= 0 && (m(), y?.());
31
+ const H = w(Math.max(f, 0), e);
32
+ j(H), $(R);
33
33
  }, 1e3 / 30);
34
34
  };
35
- b(() => (!s.current && S && o.valueOf() >= Date.now() && V(), () => {
36
- u();
35
+ P(() => (!s.current && D && o.valueOf() >= Date.now() && V(), () => {
36
+ m();
37
37
  }), [n.start]);
38
- const R = _(c) ? c(m, f) : f;
39
- return /* @__PURE__ */ M(
38
+ const F = T(i) ? i(l, c) : c;
39
+ return /* @__PURE__ */ I(
40
40
  "div",
41
41
  {
42
42
  ref: h,
43
- className: k(`${t}`, `${t}-countdown`, x),
44
- style: y,
43
+ className: b(`${t}`, `${t}-countdown`, N),
44
+ style: x,
45
45
  children: [
46
- l && /* @__PURE__ */ i("div", { className: `${t}-title`, children: l }),
47
- /* @__PURE__ */ i("div", { className: `${t}-content`, children: /* @__PURE__ */ i("div", { className: `${t}-value`, style: C, children: R }) })
46
+ r && /* @__PURE__ */ a("div", { className: `${t}-title`, children: r }),
47
+ /* @__PURE__ */ a("div", { className: `${t}-content`, children: /* @__PURE__ */ a("div", { className: `${t}-value`, style: C, children: F }) })
48
48
  ]
49
49
  }
50
50
  );
51
51
  }
52
- const A = E(z);
53
- A.displayName = "StatisticCountdown";
52
+ const z = _(q);
53
+ z.displayName = "StatisticCountdown";
54
54
  export {
55
- A as default
55
+ z as default
56
56
  };
@@ -4,119 +4,119 @@ import { quartOut as W } from "../dist/tween/src/easing.js";
4
4
  import z from "dayjs";
5
5
  import A from "lodash/isFunction";
6
6
  import c from "lodash/isNumber";
7
- import { forwardRef as B, useContext as G, useRef as C, useState as J, useEffect as K, useImperativeHandle as Q, useMemo as X } from "react";
7
+ import { forwardRef as B, useContext as G, useRef as F, useState as J, useEffect as K, useImperativeHandle as Q, useMemo as X } from "react";
8
8
  import "../config-provider/ConfigProvider.js";
9
9
  import Y from "../components/common/hooks/useMergeProps.js";
10
10
  import Z from "../skeleton/index.js";
11
11
  import tt from "@unicom-cloud/utils/class-name";
12
12
  import { omit as et } from "../components/common/utils/omit.js";
13
- import rt from "./Countdown.js";
14
- import ot from "../config-provider/context.js";
15
- function nt(R, U) {
16
- const V = {
13
+ import ot from "./Countdown.js";
14
+ import rt from "../config-provider/context.js";
15
+ function nt(y, D) {
16
+ const R = {
17
17
  countFrom: 0,
18
18
  countDuration: 2e3
19
- }, { getPrefixCls: m, componentConfig: d, rtl: j } = G(ot), t = Y(
19
+ }, { getPrefixCls: U, componentConfig: P, rtl: V } = G(rt), t = Y(
20
+ y,
20
21
  R,
21
- V,
22
- d == null ? void 0 : d.Statistic
22
+ P?.Statistic
23
23
  ), {
24
- className: M,
25
- style: q,
26
- title: S,
27
- extra: $,
28
- groupSeparator: w,
24
+ className: j,
25
+ style: M,
26
+ title: x,
27
+ extra: g,
28
+ groupSeparator: h,
29
29
  precision: s,
30
- prefix: p,
30
+ prefix: m,
31
31
  suffix: u,
32
- format: f,
33
- renderFormat: F,
34
- styleValue: O,
35
- styleDecimal: P,
32
+ format: p,
33
+ renderFormat: S,
34
+ styleValue: q,
35
+ styleDecimal: O,
36
36
  loading: _,
37
37
  ...k
38
- } = t, i = C(), g = C(), [e, v] = J(
38
+ } = t, i = F(), C = F(), [e, d] = J(
39
39
  "value" in t ? t.value : void 0
40
- ), r = m == null ? void 0 : m("statistic"), N = (n = t.countFrom, o = t.value) => {
41
- const { countDuration: h } = t;
42
- n !== o && (i.current = new T({
40
+ ), o = U?.("statistic"), f = (n = t.countFrom, r = t.value) => {
41
+ const { countDuration: N } = t;
42
+ n !== r && (i.current = new T({
43
43
  from: {
44
44
  value: n
45
45
  },
46
46
  to: {
47
- value: o
47
+ value: r
48
48
  },
49
- duration: h,
49
+ duration: N,
50
50
  easing: W,
51
51
  onUpdate: (I) => {
52
- v(I.value.toFixed(s));
52
+ d(I.value.toFixed(s));
53
53
  },
54
54
  onFinish: () => {
55
- v(o);
55
+ d(r);
56
56
  }
57
57
  }), i.current.start());
58
58
  };
59
- K(() => (t.countUp ? (i.current && i.current.stop(), e !== t.value ? N(Number(e), t.value) : N()) : v(t.value), () => {
59
+ K(() => (t.countUp ? (i.current && i.current.stop(), e !== t.value ? f(Number(e), t.value) : f()) : d(t.value), () => {
60
60
  i.current && i.current.stop(), i.current = null;
61
- }), [t.value]), Q(U, () => ({
62
- countUp: N,
63
- getRootDOMNode: () => g.current
61
+ }), [t.value]), Q(D, () => ({
62
+ countUp: f,
63
+ getRootDOMNode: () => C.current
64
64
  }));
65
- const { int: E, decimal: x } = X(() => {
65
+ const { int: E, decimal: v } = X(() => {
66
66
  let n = e;
67
- f && (n = z(e).format(f)), c(s) && s >= 0 && (n = Number(e).toFixed(s));
68
- let o = String(n).split(".")[0];
69
- const h = String(n).split(".")[1];
70
- return w && c(Number(e)) && (o = Number(o).toLocaleString("en-US")), {
71
- int: o,
72
- decimal: h
67
+ p && (n = z(e).format(p)), c(s) && s >= 0 && (n = Number(e).toFixed(s));
68
+ let r = String(n).split(".")[0];
69
+ const N = String(n).split(".")[1];
70
+ return h && c(Number(e)) && (r = Number(r).toLocaleString("en-US")), {
71
+ int: r,
72
+ decimal: N
73
73
  };
74
- }, [f, w, s, e]), H = A(F) ? F : (n, o) => o, b = c(Number(e)), y = /* @__PURE__ */ l(L, { children: [
75
- p != null ? /* @__PURE__ */ a("span", { className: `${r}-value-prefix`, children: p }) : null,
76
- H(e, b ? E : e)
74
+ }, [p, h, s, e]), H = A(S) ? S : (n, r) => r, $ = c(Number(e)), w = /* @__PURE__ */ l(L, { children: [
75
+ m != null ? /* @__PURE__ */ a("span", { className: `${o}-value-prefix`, children: m }) : null,
76
+ H(e, $ ? E : e)
77
77
  ] });
78
78
  return /* @__PURE__ */ l(
79
79
  "div",
80
80
  {
81
- className: tt(`${r}`, { [`${r}-rtl`]: j }, M),
82
- style: q,
81
+ className: tt(`${o}`, { [`${o}-rtl`]: V }, j),
82
+ style: M,
83
83
  ...et(k, ["value", "countUp", "countFrom", "countDuration"]),
84
- ref: g,
84
+ ref: C,
85
85
  children: [
86
- S && /* @__PURE__ */ a("div", { className: `${r}-title`, children: S }),
87
- /* @__PURE__ */ l("div", { className: `${r}-content`, children: [
86
+ x && /* @__PURE__ */ a("div", { className: `${o}-title`, children: x }),
87
+ /* @__PURE__ */ l("div", { className: `${o}-content`, children: [
88
88
  /* @__PURE__ */ a(
89
89
  Z,
90
90
  {
91
91
  animation: !0,
92
92
  loading: !!_,
93
93
  text: { rows: 1, width: "100%" },
94
- children: /* @__PURE__ */ l("div", { className: `${r}-value`, style: O, children: [
95
- b ? /* @__PURE__ */ a("span", { className: `${r}-value-int`, children: y }) : y,
96
- x !== void 0 || u ? /* @__PURE__ */ l(
94
+ children: /* @__PURE__ */ l("div", { className: `${o}-value`, style: q, children: [
95
+ $ ? /* @__PURE__ */ a("span", { className: `${o}-value-int`, children: w }) : w,
96
+ v !== void 0 || u ? /* @__PURE__ */ l(
97
97
  "span",
98
98
  {
99
- className: `${r}-value-decimal`,
100
- style: P,
99
+ className: `${o}-value-decimal`,
100
+ style: O,
101
101
  children: [
102
- c(Number(e)) && x !== void 0 && `.${x}`,
103
- u != null ? /* @__PURE__ */ a("span", { className: `${r}-value-suffix`, children: u }) : null
102
+ c(Number(e)) && v !== void 0 && `.${v}`,
103
+ u != null ? /* @__PURE__ */ a("span", { className: `${o}-value-suffix`, children: u }) : null
104
104
  ]
105
105
  }
106
106
  ) : null
107
107
  ] })
108
108
  }
109
109
  ),
110
- $ && /* @__PURE__ */ a("div", { className: `${r}-extra`, children: $ })
110
+ g && /* @__PURE__ */ a("div", { className: `${o}-extra`, children: g })
111
111
  ] })
112
112
  ]
113
113
  }
114
114
  );
115
115
  }
116
- const it = B(nt), D = it;
117
- D.displayName = "Statistic";
118
- D.Countdown = rt;
116
+ const it = B(nt), b = it;
117
+ b.displayName = "Statistic";
118
+ b.Countdown = ot;
119
119
  export {
120
- rt as StatisticCountdown,
121
- D as default
120
+ ot as StatisticCountdown,
121
+ b as default
122
122
  };
package/steps/Step.js CHANGED
@@ -1,68 +1,68 @@
1
- import { jsx as s, jsxs as h } from "react/jsx-runtime";
2
- import R from "@unicom-cloud/icons/IconUiCheck";
3
- import W from "@unicom-cloud/icons/IconUiClose";
4
- import { forwardRef as q } from "react";
5
- import z from "@unicom-cloud/utils/class-name";
6
- function A(x, S) {
1
+ import { jsx as s, jsxs as $ } from "react/jsx-runtime";
2
+ import P from "@unicom-cloud/icons/IconUiCheck";
3
+ import R from "@unicom-cloud/icons/IconUiClose";
4
+ import { forwardRef as W } from "react";
5
+ import q from "@unicom-cloud/utils/class-name";
6
+ function z(h, v) {
7
7
  const {
8
8
  style: C,
9
- className: b,
9
+ className: x,
10
10
  prefixCls: e,
11
11
  index: i = 1,
12
12
  current: o = 1,
13
- status: d,
14
- title: f,
13
+ status: a,
14
+ title: m,
15
15
  description: r,
16
16
  icon: l,
17
- nextStepError: w,
18
- type: p,
19
- customDot: N,
20
- labelPlacement: y,
21
- disabled: u,
22
- onClick: a,
23
- onChange: m,
24
- direction: I,
25
- id: $,
26
- lineless: j
27
- } = x;
28
- function k(c) {
29
- if (p === "dot")
17
+ nextStepError: S,
18
+ type: d,
19
+ customDot: f,
20
+ labelPlacement: k,
21
+ disabled: p,
22
+ onClick: b,
23
+ onChange: w,
24
+ direction: y,
25
+ id: N,
26
+ lineless: I
27
+ } = h;
28
+ function j(n) {
29
+ if (d === "dot")
30
30
  return null;
31
- let n = i;
32
- return l ? n = l : c === "finish" ? n = /* @__PURE__ */ s(R, {}) : c === "error" && (n = /* @__PURE__ */ s(W, {})), /* @__PURE__ */ s("div", { className: `${e}-icon`, children: n });
31
+ let c = i;
32
+ return l ? c = l : n === "finish" ? c = /* @__PURE__ */ s(P, {}) : n === "error" && (c = /* @__PURE__ */ s(R, {})), /* @__PURE__ */ s("div", { className: `${e}-icon`, children: c });
33
33
  }
34
- function D(c) {
35
- u || (o !== i && (m == null || m(i, $)), a == null || a(i, $, c));
34
+ function D(n) {
35
+ p || (o !== i && w?.(i, N), b?.(i, N, n));
36
36
  }
37
37
  let t;
38
- d ? t = d : (o < i && (t = "wait"), o === i && (t = "process"), o > i && (t = "finish"));
39
- const E = z(
38
+ a ? t = a : (o < i && (t = "wait"), o === i && (t = "process"), o > i && (t = "finish"));
39
+ const E = q(
40
40
  `${e}-item`,
41
41
  `${e}-item-${t}`,
42
42
  {
43
43
  [`${e}-item-custom`]: !!l,
44
- [`${e}-item-next-error`]: w,
45
- [`${e}-item-disabled`]: u,
44
+ [`${e}-item-next-error`]: S,
45
+ [`${e}-item-disabled`]: p,
46
46
  [`${e}-item-active`]: i === o
47
47
  },
48
- b
49
- ), U = k(t), v = /* @__PURE__ */ s("div", { className: `${e}-item-icon`, children: U }), P = N ? N(v, {
48
+ x
49
+ ), U = j(t), u = /* @__PURE__ */ s("div", { className: `${e}-item-icon`, children: U }), g = f ? f(u, {
50
50
  index: i,
51
51
  status: t,
52
- title: f,
52
+ title: m,
53
53
  description: r
54
- }) : v;
55
- return /* @__PURE__ */ h("div", { ref: S, className: E, style: C, onClick: D, children: [
56
- !j && (y === "vertical" || I === "vertical") && /* @__PURE__ */ s("div", { className: `${e}-item-tail` }),
57
- p !== "arrow" && P,
58
- /* @__PURE__ */ h("div", { className: `${e}-item-content`, children: [
59
- /* @__PURE__ */ s("div", { className: `${e}-item-title`, children: f }),
54
+ }) : u;
55
+ return /* @__PURE__ */ $("div", { ref: v, className: E, style: C, onClick: D, children: [
56
+ !I && (k === "vertical" || y === "vertical") && /* @__PURE__ */ s("div", { className: `${e}-item-tail` }),
57
+ d !== "arrow" && g,
58
+ /* @__PURE__ */ $("div", { className: `${e}-item-content`, children: [
59
+ /* @__PURE__ */ s("div", { className: `${e}-item-title`, children: m }),
60
60
  r && /* @__PURE__ */ s("div", { className: `${e}-item-description`, children: r })
61
61
  ] })
62
62
  ] });
63
63
  }
64
- const B = q(A);
65
- B.displayName = "Step";
64
+ const A = W(z);
65
+ A.displayName = "Step";
66
66
  export {
67
- B as default
67
+ A as default
68
68
  };