@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.
- package/Affix.js +1 -1
- package/Carousel.js +1 -1
- package/LiquidFill.js +4 -0
- package/OverflowEllipsis.js +1 -1
- package/PageHeader.js +1 -1
- package/QrCode.js +57 -0
- package/Tour.js +63 -0
- package/Trigger.js +1 -1
- package/_virtual/_commonjsHelpers.js +6 -0
- package/_virtual/index.js +7 -0
- package/_virtual/index2.js +4 -0
- package/affix/index.js +70 -72
- package/alert/index.js +56 -56
- package/anchor/Anchor.js +55 -55
- package/anchor/Link.js +34 -34
- package/anchor/util.js +5 -5
- package/auto-complete/index.js +116 -122
- package/avatar/Avatar.js +33 -33
- package/avatar/Group.js +26 -26
- package/back-top/index.js +58 -61
- package/badge/index.js +46 -46
- package/breadcrumb/Item.js +42 -43
- package/breadcrumb/index.js +47 -47
- package/button/Group.js +6 -6
- package/button/index.js +91 -91
- package/calendar/Month.js +75 -75
- package/calendar/Year.js +35 -35
- package/calendar/header/index.js +25 -25
- package/calendar/index.js +103 -103
- package/card/Grid.js +8 -8
- package/card/Meta.js +16 -16
- package/card/index.js +49 -49
- package/carousel/Arrow.js +19 -19
- package/carousel/Indicator.js +26 -26
- package/carousel/index.js +108 -108
- package/cascader/Cascader.js +178 -191
- package/cascader/base/node.js +133 -136
- package/cascader/base/store.js +82 -85
- package/cascader/panel/List.js +125 -129
- package/cascader/panel/Search.js +79 -81
- package/cascader/util.js +13 -13
- package/checkbox/Checkbox.js +94 -96
- package/checkbox/Group.js +54 -56
- package/checkbox/GroupBlock.js +28 -29
- package/collapse/Collapse.js +45 -45
- package/collapse/Item.js +53 -55
- package/color-picker/ControlBar.js +43 -43
- package/color-picker/InputAlpha.js +12 -12
- package/color-picker/InputHex.js +30 -31
- package/color-picker/InputRgb.js +24 -24
- package/color-picker/Palette.js +18 -18
- package/color-picker/Panel.js +122 -125
- package/color-picker/hooks/useColorPicker.js +85 -88
- package/color-picker/hooks/useControlBlock.js +38 -40
- package/color-picker/index.js +47 -47
- package/comment/index.js +29 -29
- package/components/common/higher-order/with-speech-synthesis/index.js +37 -40
- package/components/common/hooks/useId.js +8 -8
- package/components/common/hooks/useInView.js +16 -16
- package/components/common/hooks/useIntersectionObserver.js +1 -1
- package/components/common/hooks/useKeyboardEvent.js +9 -10
- package/components/common/hooks/useOverflowHidden.js +1 -4
- package/components/common/hooks/usePersistCallback.js +7 -7
- package/components/common/hooks/useStateCallback.js +9 -10
- package/components/common/hooks/useWindowSize.js +8 -8
- package/components/common/space/index.js +9 -7
- package/components/common/utils/convertToDurationBasedOnTimeUnits.js +6 -0
- package/components/common/utils/dom.js +27 -29
- package/components/common/utils/findScrollParent.js +17 -0
- package/components/common/utils/intersectionObserver.js +21 -0
- package/components/common/utils/is.js +99 -109
- package/components/common/utils/mutationObserver.js +19 -0
- package/components/common/utils/reactDOM.js +34 -34
- package/components/common/utils/resizeObserver.js +21 -0
- package/copy/index.js +38 -40
- package/date-picker/Picker.js +290 -295
- package/date-picker/RangePicker.js +367 -372
- package/date-picker/index.js +33 -35
- package/date-picker/panel/Body.js +46 -47
- package/date-picker/panel/Header.js +33 -33
- package/date-picker/panel/Shortcut.js +31 -31
- package/date-picker/panel/date/index.js +85 -85
- package/date-picker/panel/month/index.js +59 -59
- package/date-picker/panel/quarter/index.js +67 -70
- package/date-picker/panel/range/index.js +101 -101
- package/date-picker/panel/year/index.js +39 -39
- package/date-picker/util.js +17 -18
- package/descriptions/index.js +62 -62
- package/details/index.js +53 -55
- package/development/index.js +9 -9
- package/dist/tinycolor/chunk/BOzCVdr0.js +1 -1
- package/dist/validate/src/index.js +5 -5
- package/dist/validate/src/util.js +1 -1
- package/divider/index.js +21 -21
- package/draggable/Item.js +35 -35
- package/draggable/index.js +22 -22
- package/drawer/Drawer.js +142 -147
- package/dropdown/Button.js +48 -48
- package/dropdown/index.js +88 -92
- package/empty/index.js +16 -16
- package/form/Control.js +211 -225
- package/form/Form.js +109 -113
- package/form/FormItem.js +118 -120
- package/form/FormList.js +60 -66
- package/form/FormProvider.js +31 -34
- package/form/hook/useContext.js +17 -19
- package/form/hook/useState.js +22 -23
- package/form/hook/useWatch.js +26 -27
- package/form/promisify.js +14 -18
- package/form/store.js +304 -316
- package/form/util.js +14 -15
- package/grid/Col.js +64 -64
- package/grid/Grid.js +51 -51
- package/grid/GridItem.js +48 -48
- package/grid/Row.js +39 -39
- package/hooks/useVerificationCode.js +41 -43
- package/hooks/useWatermark.js +89 -92
- package/icon/index.js +23 -24
- package/icon-hover/index.js +16 -16
- package/icons/file.js +11 -11
- package/image/Image.js +140 -141
- package/image/ImagePreview.js +252 -255
- package/image/ImagePreviewArrow.js +25 -25
- package/image/ImagePreviewGroup.js +62 -62
- package/image/util/getScale.js +25 -28
- package/index.js +684 -675
- package/input/Button.js +48 -50
- package/input/Group.js +9 -9
- package/input/Input.js +145 -154
- package/input/InputElement.js +108 -115
- package/input/Password.js +38 -38
- package/input/Search.js +51 -55
- package/input/Textarea.js +80 -81
- package/input/useComposition.js +23 -23
- package/input-number/decimal.js +59 -62
- package/input-number/index.js +139 -141
- package/input-tag/InputTag.js +222 -230
- package/layout/Content.js +6 -6
- package/layout/Footer.js +8 -8
- package/layout/Header.js +7 -7
- package/layout/Sider.js +88 -90
- package/layout/index.js +30 -30
- package/link/index.js +45 -46
- package/liquid-fill/LiquidFill.js +226 -0
- package/liquid-fill/LiquidFill2.js +3 -0
- package/liquid-fill/index.js +4 -0
- package/list/Item.js +28 -28
- package/list/Meta.js +12 -12
- package/list/index.js +146 -148
- package/mentions/index.js +75 -76
- package/menu/Item.js +58 -58
- package/menu/Menu.js +125 -127
- package/menu/OverflowWrap.js +39 -40
- package/menu/sub-menu/Inline.js +45 -45
- package/menu/util.js +26 -28
- package/message/index.js +96 -99
- package/message/useMessage.js +26 -27
- package/modal/Confirm.js +47 -49
- package/modal/Modal.js +250 -257
- package/modal/use-modal/Hook.js +26 -28
- package/modal/use-modal/index.js +46 -49
- package/notice/index.js +89 -90
- package/notification/index.js +60 -65
- package/notification/withNotification.js +35 -35
- package/overflow-ellipsis/OverflowItem.js +19 -20
- package/overflow-ellipsis/index.js +45 -46
- package/package.json +1 -1
- package/page-header/index.js +45 -45
- package/pagination/PageItem.js +87 -91
- package/pagination/PageJumper.js +40 -41
- package/pagination/PageOption.js +31 -35
- package/pagination/Pagination.js +162 -163
- package/picker/Input.js +90 -96
- package/picker/InputRange.js +115 -122
- package/popconfirm/index.js +98 -100
- package/popover/index.js +28 -28
- package/portal/Portal.js +10 -11
- package/progress/index.js +36 -36
- package/qr-code/index.js +99 -0
- package/qr-code/interface.js +1 -0
- package/radio/Group.js +48 -48
- package/radio/GroupBlock.js +32 -33
- package/radio/Radio.js +62 -64
- package/rate/index.js +88 -88
- package/resize-box/ResizeTrigger.js +39 -39
- package/resize-box/Split.js +92 -96
- package/resize-box/SplitGroup.js +116 -122
- package/resize-box/index.js +112 -115
- package/result/index.js +44 -44
- package/select/Option.js +53 -56
- package/select/Select.js +365 -381
- package/select/util.js +95 -99
- package/select-view/Core.js +159 -160
- package/skeleton/index.js +23 -23
- package/slider/Button.js +84 -92
- package/slider/Input.js +47 -49
- package/slider/Tick.js +28 -31
- package/slider/index.js +107 -107
- package/space/index.js +26 -26
- package/space-/index.js +51 -51
- package/spin/DotLoading.js +8 -8
- package/spin/index.js +47 -47
- package/statistic/Countdown.js +37 -37
- package/statistic/index.js +58 -58
- package/steps/Step.js +42 -42
- package/steps/index.js +54 -54
- package/style.css +1 -1
- package/switch/index.js +77 -78
- package/table/ColGroup.js +36 -37
- package/table/Table.js +447 -450
- package/table/hook/useExpand.js +24 -24
- package/table/hook/useRowSelection.js +62 -62
- package/table/summary/Row.js +16 -17
- package/table/tbody/Td.js +119 -118
- package/table/tbody/Tr.js +119 -121
- package/table/tbody/index.js +62 -63
- package/table/th-resizable/index.js +30 -30
- package/table/thead/Column.js +148 -148
- package/table/thead/index.js +87 -88
- package/tabs/Tab.js +55 -55
- package/tabs/TabContent.js +8 -8
- package/tabs/TabPane.js +15 -15
- package/tabs/hook/useHeaderScroll.js +36 -36
- package/tabs/tab-header/TabInk.js +31 -33
- package/tabs/tab-header/TabNavIcon.js +34 -35
- package/tabs/tab-header/index.js +192 -195
- package/tag/index.js +94 -97
- package/time-picker/Picker.js +167 -172
- package/time-picker/RangePicker.js +28 -28
- package/time-picker/TimePicker.js +146 -146
- package/timeline/Item.js +46 -46
- package/timeline/Timeline.js +52 -52
- package/tooltip/index.js +89 -95
- package/tour/index.js +289 -0
- package/transfer/Item.js +54 -54
- package/transfer/List.js +134 -136
- package/transfer/index.js +91 -91
- package/tree/Animation.js +49 -52
- package/tree/Node.js +114 -122
- package/tree/NodeList.js +51 -51
- package/tree/Tree.js +386 -393
- package/tree-select/List.js +71 -72
- package/tree-select/Select.js +135 -143
- package/tree-select/hook/useKeyCache.js +39 -39
- package/tree-select/hook/useStateValue.js +12 -12
- package/trigger/getPopupStyle.js +60 -61
- package/trigger/index.js +337 -346
- package/types/common/space/interface.d.ts +1 -1
- package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
- package/types/common/utils/findScrollParent.d.ts +2 -0
- package/types/common/utils/index.d.ts +5 -0
- package/types/common/utils/intersectionObserver.d.ts +2 -0
- package/types/common/utils/mutationObserver.d.ts +2 -0
- package/types/common/utils/resizeObserver.d.ts +2 -0
- package/types/pc/config-provider/interface.d.ts +6 -0
- package/types/pc/index.d.ts +3 -0
- package/types/pc/liquid-fill/LiquidFill.d.ts +115 -0
- package/types/pc/liquid-fill/LiquidFill2.d.ts +1 -0
- package/types/pc/liquid-fill/index.d.ts +2 -0
- package/types/pc/qr-code/index.d.ts +34 -0
- package/types/pc/qr-code/interface.d.ts +39 -0
- package/types/pc/table/interface.d.ts +2 -2
- package/types/pc/tour/index.d.ts +42 -0
- package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +3 -0
- package/types/pc/utils/findScrollParent.d.ts +2 -0
- package/types/pc/utils/index.d.ts +5 -0
- package/types/pc/utils/intersectionObserver.d.ts +2 -0
- package/types/pc/utils/mutationObserver.d.ts +2 -0
- package/types/pc/utils/names.d.ts +18 -0
- package/types/pc/utils/resizeObserver.d.ts +2 -0
- package/typography/Base.js +79 -81
- package/typography/EditContent.js +30 -33
- package/typography/Ellipsis.js +77 -73
- package/typography/Operations.js +50 -52
- package/typography/Paragraph.js +7 -7
- package/typography/Typography.js +7 -7
- package/typography/useEllipsis.js +105 -106
- package/upload/TriggerNode.js +69 -76
- package/upload/Upload.js +84 -87
- package/upload/Uploader.js +115 -118
- package/upload/list/PictureItem.js +61 -71
- package/upload/list/TextItem.js +61 -67
- package/upload/list/UploadProgress.js +42 -49
- package/upload/list/index.js +48 -49
- package/upload/request_.js +37 -38
- package/upload/util.js +39 -39
- package/utils/convertToDurationBasedOnTimeUnits.js +6 -0
- package/utils/findScrollParent.js +4 -0
- package/utils/index.js +281 -278
- package/utils/intersectionObserver.js +4 -0
- package/utils/mutationObserver.js +4 -0
- package/utils/names.js +12 -0
- package/utils/resizeObserver.js +4 -0
- package/verification-code/VerificationCode.js +50 -51
- package/version/index.js +1 -1
- package/virtual-list/VirtualList.js +243 -244
- package/virtual-list/util/item.js +3 -4
- package/watermark/Watermark.js +27 -31
- package/components/common/utils/resizeObserverEffect.js +0 -23
- package/types/common/utils/resizeObserverEffect.d.ts +0 -2
- package/types/pc/utils/resizeObserverEffect.d.ts +0 -2
- package/utils/resizeObserverEffect.js +0 -4
package/spin/index.js
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
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
|
|
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
|
|
7
|
-
import
|
|
8
|
-
import { isEmptyReactNode as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
function
|
|
12
|
-
const { getPrefixCls:
|
|
13
|
-
style:
|
|
14
|
-
className:
|
|
15
|
-
children:
|
|
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:
|
|
18
|
-
icon:
|
|
19
|
-
element:
|
|
17
|
+
size: t,
|
|
18
|
+
icon: c,
|
|
19
|
+
element: b,
|
|
20
20
|
tip: o,
|
|
21
|
-
dot:
|
|
21
|
+
dot: R,
|
|
22
22
|
delay: i,
|
|
23
|
-
block:
|
|
23
|
+
block: z = !1,
|
|
24
24
|
...k
|
|
25
|
-
} =
|
|
26
|
-
|
|
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:
|
|
29
|
-
loading:
|
|
30
|
-
setLoading:
|
|
31
|
-
debouncedSetLoading:
|
|
32
|
-
})),
|
|
33
|
-
|
|
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
|
|
36
|
-
className:
|
|
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:
|
|
38
|
+
fontSize: t
|
|
39
39
|
}
|
|
40
|
-
}) :
|
|
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:
|
|
45
|
-
className:
|
|
44
|
+
ref: f,
|
|
45
|
+
className: N(
|
|
46
46
|
e,
|
|
47
47
|
{
|
|
48
|
-
[`${e}-block`]:
|
|
49
|
-
[`${e}-loading`]:
|
|
50
|
-
[`${e}-with-tip`]: o && !
|
|
48
|
+
[`${e}-block`]: z,
|
|
49
|
+
[`${e}-loading`]: p,
|
|
50
|
+
[`${e}-with-tip`]: o && !l
|
|
51
51
|
},
|
|
52
|
-
|
|
52
|
+
L
|
|
53
53
|
),
|
|
54
|
-
style:
|
|
54
|
+
style: v,
|
|
55
55
|
...k,
|
|
56
|
-
children:
|
|
57
|
-
|
|
56
|
+
children: U(l) ? /* @__PURE__ */ r(u, { children: [
|
|
57
|
+
g,
|
|
58
58
|
o ? /* @__PURE__ */ n("div", { className: `${e}-tip`, children: o }) : null
|
|
59
|
-
] }) : /* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */ n("div", { className: `${e}-children`, children:
|
|
61
|
-
|
|
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:
|
|
66
|
-
children: /* @__PURE__ */
|
|
67
|
-
|
|
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
|
|
77
|
-
|
|
76
|
+
const B = h.forwardRef(A);
|
|
77
|
+
B.displayName = "Spin";
|
|
78
78
|
export {
|
|
79
|
-
|
|
79
|
+
B as default
|
|
80
80
|
};
|
package/statistic/Countdown.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { forwardRef as
|
|
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
|
|
7
|
-
import { getDayjsValue as
|
|
8
|
-
import { getDateString as
|
|
9
|
-
import
|
|
10
|
-
function
|
|
11
|
-
const { getPrefixCls:
|
|
12
|
-
className:
|
|
13
|
-
style:
|
|
14
|
-
title:
|
|
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:
|
|
17
|
-
onFinish:
|
|
18
|
-
renderFormat:
|
|
16
|
+
value: g,
|
|
17
|
+
onFinish: y,
|
|
18
|
+
renderFormat: i,
|
|
19
19
|
format: e = "HH:mm:ss",
|
|
20
|
-
start:
|
|
21
|
-
} = n, o =
|
|
22
|
-
o.diff(
|
|
23
|
-
), [
|
|
24
|
-
|
|
25
|
-
), s = O(null),
|
|
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
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
j(
|
|
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
|
-
|
|
36
|
-
|
|
35
|
+
P(() => (!s.current && D && o.valueOf() >= Date.now() && V(), () => {
|
|
36
|
+
m();
|
|
37
37
|
}), [n.start]);
|
|
38
|
-
const
|
|
39
|
-
return /* @__PURE__ */
|
|
38
|
+
const F = T(i) ? i(l, c) : c;
|
|
39
|
+
return /* @__PURE__ */ I(
|
|
40
40
|
"div",
|
|
41
41
|
{
|
|
42
42
|
ref: h,
|
|
43
|
-
className:
|
|
44
|
-
style:
|
|
43
|
+
className: b(`${t}`, `${t}-countdown`, N),
|
|
44
|
+
style: x,
|
|
45
45
|
children: [
|
|
46
|
-
|
|
47
|
-
/* @__PURE__ */
|
|
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
|
|
53
|
-
|
|
52
|
+
const z = _(q);
|
|
53
|
+
z.displayName = "StatisticCountdown";
|
|
54
54
|
export {
|
|
55
|
-
|
|
55
|
+
z as default
|
|
56
56
|
};
|
package/statistic/index.js
CHANGED
|
@@ -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
|
|
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
|
|
14
|
-
import
|
|
15
|
-
function nt(
|
|
16
|
-
const
|
|
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:
|
|
19
|
+
}, { getPrefixCls: U, componentConfig: P, rtl: V } = G(rt), t = Y(
|
|
20
|
+
y,
|
|
20
21
|
R,
|
|
21
|
-
|
|
22
|
-
d == null ? void 0 : d.Statistic
|
|
22
|
+
P?.Statistic
|
|
23
23
|
), {
|
|
24
|
-
className:
|
|
25
|
-
style:
|
|
26
|
-
title:
|
|
27
|
-
extra:
|
|
28
|
-
groupSeparator:
|
|
24
|
+
className: j,
|
|
25
|
+
style: M,
|
|
26
|
+
title: x,
|
|
27
|
+
extra: g,
|
|
28
|
+
groupSeparator: h,
|
|
29
29
|
precision: s,
|
|
30
|
-
prefix:
|
|
30
|
+
prefix: m,
|
|
31
31
|
suffix: u,
|
|
32
|
-
format:
|
|
33
|
-
renderFormat:
|
|
34
|
-
styleValue:
|
|
35
|
-
styleDecimal:
|
|
32
|
+
format: p,
|
|
33
|
+
renderFormat: S,
|
|
34
|
+
styleValue: q,
|
|
35
|
+
styleDecimal: O,
|
|
36
36
|
loading: _,
|
|
37
37
|
...k
|
|
38
|
-
} = t, i =
|
|
38
|
+
} = t, i = F(), C = F(), [e, d] = J(
|
|
39
39
|
"value" in t ? t.value : void 0
|
|
40
|
-
),
|
|
41
|
-
const { countDuration:
|
|
42
|
-
n !==
|
|
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:
|
|
47
|
+
value: r
|
|
48
48
|
},
|
|
49
|
-
duration:
|
|
49
|
+
duration: N,
|
|
50
50
|
easing: W,
|
|
51
51
|
onUpdate: (I) => {
|
|
52
|
-
|
|
52
|
+
d(I.value.toFixed(s));
|
|
53
53
|
},
|
|
54
54
|
onFinish: () => {
|
|
55
|
-
|
|
55
|
+
d(r);
|
|
56
56
|
}
|
|
57
57
|
}), i.current.start());
|
|
58
58
|
};
|
|
59
|
-
K(() => (t.countUp ? (i.current && i.current.stop(), e !== 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(
|
|
62
|
-
countUp:
|
|
63
|
-
getRootDOMNode: () =>
|
|
61
|
+
}), [t.value]), Q(D, () => ({
|
|
62
|
+
countUp: f,
|
|
63
|
+
getRootDOMNode: () => C.current
|
|
64
64
|
}));
|
|
65
|
-
const { int: E, decimal:
|
|
65
|
+
const { int: E, decimal: v } = X(() => {
|
|
66
66
|
let n = e;
|
|
67
|
-
|
|
68
|
-
let
|
|
69
|
-
const
|
|
70
|
-
return
|
|
71
|
-
int:
|
|
72
|
-
decimal:
|
|
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
|
-
}, [
|
|
75
|
-
|
|
76
|
-
H(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(`${
|
|
82
|
-
style:
|
|
81
|
+
className: tt(`${o}`, { [`${o}-rtl`]: V }, j),
|
|
82
|
+
style: M,
|
|
83
83
|
...et(k, ["value", "countUp", "countFrom", "countDuration"]),
|
|
84
|
-
ref:
|
|
84
|
+
ref: C,
|
|
85
85
|
children: [
|
|
86
|
-
|
|
87
|
-
/* @__PURE__ */ l("div", { className: `${
|
|
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: `${
|
|
95
|
-
|
|
96
|
-
|
|
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: `${
|
|
100
|
-
style:
|
|
99
|
+
className: `${o}-value-decimal`,
|
|
100
|
+
style: O,
|
|
101
101
|
children: [
|
|
102
|
-
c(Number(e)) &&
|
|
103
|
-
u != null ? /* @__PURE__ */ a("span", { className: `${
|
|
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
|
-
|
|
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),
|
|
117
|
-
|
|
118
|
-
|
|
116
|
+
const it = B(nt), b = it;
|
|
117
|
+
b.displayName = "Statistic";
|
|
118
|
+
b.Countdown = ot;
|
|
119
119
|
export {
|
|
120
|
-
|
|
121
|
-
|
|
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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import
|
|
6
|
-
function
|
|
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:
|
|
9
|
+
className: x,
|
|
10
10
|
prefixCls: e,
|
|
11
11
|
index: i = 1,
|
|
12
12
|
current: o = 1,
|
|
13
|
-
status:
|
|
14
|
-
title:
|
|
13
|
+
status: a,
|
|
14
|
+
title: m,
|
|
15
15
|
description: r,
|
|
16
16
|
icon: l,
|
|
17
|
-
nextStepError:
|
|
18
|
-
type:
|
|
19
|
-
customDot:
|
|
20
|
-
labelPlacement:
|
|
21
|
-
disabled:
|
|
22
|
-
onClick:
|
|
23
|
-
onChange:
|
|
24
|
-
direction:
|
|
25
|
-
id:
|
|
26
|
-
lineless:
|
|
27
|
-
} =
|
|
28
|
-
function
|
|
29
|
-
if (
|
|
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
|
|
32
|
-
return l ?
|
|
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(
|
|
35
|
-
|
|
34
|
+
function D(n) {
|
|
35
|
+
p || (o !== i && w?.(i, N), b?.(i, N, n));
|
|
36
36
|
}
|
|
37
37
|
let t;
|
|
38
|
-
|
|
39
|
-
const E =
|
|
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`]:
|
|
45
|
-
[`${e}-item-disabled`]:
|
|
44
|
+
[`${e}-item-next-error`]: S,
|
|
45
|
+
[`${e}-item-disabled`]: p,
|
|
46
46
|
[`${e}-item-active`]: i === o
|
|
47
47
|
},
|
|
48
|
-
|
|
49
|
-
), U =
|
|
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:
|
|
52
|
+
title: m,
|
|
53
53
|
description: r
|
|
54
|
-
}) :
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
-
!
|
|
57
|
-
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */ s("div", { className: `${e}-item-title`, children:
|
|
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
|
|
65
|
-
|
|
64
|
+
const A = W(z);
|
|
65
|
+
A.displayName = "Step";
|
|
66
66
|
export {
|
|
67
|
-
|
|
67
|
+
A as default
|
|
68
68
|
};
|