@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.
- package/Badge.js +7 -54
- package/Copy.js +5 -4
- package/Details.js +13 -2
- package/Divider.js +3 -2
- package/Flex.js +14 -4
- package/LiquidFill.js +5 -4
- package/List.js +1 -1
- package/Loading.js +16 -3
- package/Marquee.js +5 -4
- package/QrCode.js +5 -4
- package/Space.js +3 -3
- package/Splitter.js +4 -3
- package/SuspenseFallbackTest.js +2 -4
- package/Tooltip.js +3 -4
- package/Tour.js +5 -4
- package/alert/index.js +60 -62
- package/anchor/Anchor.js +12 -12
- package/anchor/util.js +10 -10
- package/back-top/index.js +33 -34
- package/badge/index.js +109 -162
- package/calendar/index.js +85 -84
- package/card/index.js +63 -43
- package/color-picker/InputHex.js +3 -4
- package/color-picker/InputRgb.js +7 -8
- package/color-picker/Palette.js +3 -4
- package/color-picker/Panel.js +3 -4
- package/color-picker/colors.js +5 -5
- package/color-picker/hooks/useColorPicker.js +3 -4
- package/color-picker/utils.js +14 -15
- package/components/common/development/index.js +44 -29
- package/components/common/empty/index.js +35 -23
- package/components/common/flex/index.js +64 -0
- package/components/common/flex/interface.js +9 -0
- package/components/common/higher-order/with-speech-synthesis/index.js +79 -55
- package/components/common/space/index.js +71 -91
- package/components/common/suspense-fallback-test/index.js +16 -0
- package/components/common/utils/PqbCSSTransition.js +1 -1
- package/components/common/utils/constant.js +6 -3
- package/components/common/utils/reactDOM.js +6 -4
- package/components/common/utils/{scrollIntoView.js → scrollIntoViewIfNeeded.js} +1 -1
- package/components/common/utils/setPrimaryColor.js +18 -18
- package/components/common/utils/setTheme.js +8 -9
- package/components/common/utils/toArray.js +12 -0
- package/copy/index.js +3 -2
- package/details/index.js +102 -62
- package/dist/scroll-into-view-if-needed/compute/index.js +126 -0
- package/dist/scroll-into-view-if-needed/smooth/index.js +70 -0
- package/dist/scroll-into-view-if-needed/src/index.js +19 -19
- package/divider/index.js +27 -21
- package/empty/index.js +13 -13
- package/flex/index.js +43 -55
- package/flex/interface.js +1 -34
- package/form/FormItem.js +69 -65
- package/form/context.js +6 -7
- package/grid/Col-.js +86 -0
- package/grid/Col.js +156 -73
- package/grid/Grid.js +71 -67
- package/grid/Row.js +3 -3
- package/grid/index.js +13 -13
- package/icon/interface.js +1 -0
- package/icon-hover/interface.js +1 -0
- package/index.js +641 -663
- package/input/Textarea.js +1 -1
- package/input/autoSizeTextAreaHeight.js +7 -7
- package/liquid-fill/index.js +5 -4
- package/list/index.js +1 -1
- package/loading/index.js +72 -53
- package/loading/interface.js +1 -0
- package/marquee/index.js +5 -4
- package/menu/Item.js +9 -9
- package/modal/Modal.js +73 -74
- package/package.json +1 -1
- package/portal/interface.js +1 -0
- package/qr-code/index.js +5 -4
- package/segmented/index.js +47 -47
- package/space/index.js +41 -35
- package/speech-synthesis/interface.js +1 -0
- package/splitter/SplitBar.js +81 -79
- package/splitter/Splitter.js +92 -104
- package/splitter/hooks/useItems.js +1 -1
- package/splitter/hooks/useResizable.js +9 -18
- package/splitter/hooks/useResize.js +10 -10
- package/splitter/hooks/useSizes.js +28 -28
- package/splitter/index.js +5 -4
- package/statistic/index.js +10 -10
- package/style.css +1 -1
- package/suspense-fallback-test/index.js +2 -11
- package/suspense-fallback-test/interface.js +1 -0
- package/table/Table.js +376 -377
- package/table/hook/useThResizable.js +5 -4
- package/table/th-resizable/index.js +12 -11
- package/time-picker/util.js +8 -8
- package/tooltip/index.js +1 -2
- package/tour/index.js +5 -4
- package/tree/NodeList.js +1 -1
- package/trigger/index.js +67 -70
- package/types/common/development/index.d.ts +7 -1
- package/types/common/development/interface.d.ts +22 -0
- package/types/common/empty/index.d.ts +2 -1
- package/types/common/flex/index.d.ts +14 -0
- package/types/common/flex/interface.d.ts +62 -0
- package/types/common/higher-order/with-speech-synthesis/index.d.ts +6 -1
- package/types/common/higher-order/with-speech-synthesis/interface.d.ts +13 -0
- package/types/common/space/index.d.ts +4 -4
- package/types/common/space/interface.d.ts +10 -18
- package/types/common/suspense-fallback-test/index.d.ts +7 -0
- package/types/common/suspense-fallback-test/interface.d.ts +1 -0
- package/types/common/utils/PqbCSSTransition.d.ts +1 -1
- package/types/common/utils/constant.d.ts +1 -0
- package/types/common/utils/scrollIntoViewIfNeeded.d.ts +4 -0
- package/types/common/utils/toArray.d.ts +13 -0
- package/types/common/utils/tree.d.ts +1 -0
- package/types/common/utils/tween.d.ts +1 -0
- package/types/pc/alert/index.d.ts +2 -1
- package/types/pc/alert/interface.d.ts +7 -1
- package/types/pc/anchor/util.d.ts +1 -1
- package/types/pc/badge/Count.d.ts +1 -1
- package/types/pc/badge/interface.d.ts +2 -0
- package/types/pc/breadcrumb/Item.d.ts +1 -1
- package/types/pc/calendar/Month.d.ts +1 -1
- package/types/pc/calendar/WeekList.d.ts +1 -1
- package/types/pc/calendar/Year.d.ts +1 -1
- package/types/pc/calendar/header/Panel.d.ts +1 -1
- package/types/pc/calendar/header/index.d.ts +1 -1
- package/types/pc/calendar/index.d.ts +1 -1
- package/types/pc/calendar/interface.d.ts +2 -1
- package/types/pc/card/interface.d.ts +8 -0
- package/types/pc/cascader/interface.d.ts +1 -1
- package/types/pc/cascader/panel/List.d.ts +1 -1
- package/types/pc/cascader/panel/Option.d.ts +1 -1
- package/types/pc/cascader/panel/Search.d.ts +1 -1
- package/types/pc/checkbox/Group.d.ts +2 -2
- package/types/pc/checkbox/GroupBlock.d.ts +1 -1
- package/types/pc/checkbox/IconCheck.d.ts +1 -1
- package/types/pc/color-picker/InputRgb.d.ts +1 -1
- package/types/pc/color-picker/Palette.d.ts +1 -1
- package/types/pc/color-picker/hooks/useColorPicker.d.ts +7 -2
- package/types/pc/color-picker/utils.d.ts +6 -1
- package/types/pc/config-provider/ConfigProvider.d.ts +1 -1
- package/types/pc/config-provider/interface.d.ts +4 -0
- package/types/pc/copy/index.d.ts +1 -1
- package/types/pc/date-picker/panel/Body.d.ts +1 -1
- package/types/pc/date-picker/panel/Footer.d.ts +1 -1
- package/types/pc/date-picker/panel/Header.d.ts +1 -1
- package/types/pc/date-picker/panel/WeekList.d.ts +1 -1
- package/types/pc/date-picker/panel/date/index.d.ts +1 -1
- package/types/pc/date-picker/panel/month/index.d.ts +1 -1
- package/types/pc/date-picker/panel/quarter/index.d.ts +1 -1
- package/types/pc/date-picker/panel/range/index.d.ts +1 -1
- package/types/pc/date-picker/panel/week/index.d.ts +1 -1
- package/types/pc/date-picker/panel/year/index.d.ts +1 -1
- package/types/pc/descriptions/index.d.ts +1 -1
- package/types/pc/details/index.d.ts +3 -2
- package/types/pc/details/interface.d.ts +16 -0
- package/types/pc/development/index.d.ts +2 -1
- package/types/pc/development/interface.d.ts +15 -0
- package/types/pc/divider/index.d.ts +7 -2
- package/types/pc/draggable/Item.d.ts +1 -1
- package/types/pc/draggable/index.d.ts +1 -1
- package/types/pc/flex/index.d.ts +4 -4
- package/types/pc/flex/interface.d.ts +8 -53
- package/types/pc/form/Control.d.ts +1 -1
- package/types/pc/form/FormItem.d.ts +1 -1
- package/types/pc/form/FormList.d.ts +1 -1
- package/types/pc/form/IconSymbol.d.ts +1 -1
- package/types/pc/grid/Col-.d.ts +4 -0
- package/types/pc/grid/Col.d.ts +3 -2
- package/types/pc/grid/Grid.d.ts +2 -2
- package/types/pc/grid/Item.d.ts +3 -3
- package/types/pc/grid/Row.d.ts +2 -2
- package/types/pc/grid/hook/useResponsiveState.d.ts +2 -2
- package/types/pc/grid/interface.d.ts +13 -7
- package/types/pc/icon/addFromIconFontCn.d.ts +1 -7
- package/types/pc/icon/index.d.ts +2 -7
- package/types/pc/icon/interface.d.ts +13 -0
- package/types/pc/icon-hover/index.d.ts +2 -8
- package/types/pc/icon-hover/interface.d.ts +8 -0
- package/types/pc/image/ImageFooter.d.ts +1 -1
- package/types/pc/image/ImagePreviewArrow.d.ts +1 -1
- package/types/pc/image/TriggerForToolbar.d.ts +1 -1
- package/types/pc/index.d.ts +60 -51
- package/types/pc/loading/index.d.ts +4 -3
- package/types/pc/loading/interface.d.ts +6 -0
- package/types/pc/menu/Indent.d.ts +1 -1
- package/types/pc/menu/OverflowWrap.d.ts +1 -1
- package/types/pc/menu/sub-menu/Inline.d.ts +1 -1
- package/types/pc/menu/sub-menu/Pop.d.ts +1 -1
- package/types/pc/overflow-ellipsis/OverflowItem.d.ts +1 -1
- package/types/pc/overflow-ellipsis/index.d.ts +1 -1
- package/types/pc/pagination/PageItem.d.ts +3 -3
- package/types/pc/pagination/PageJumper.d.ts +1 -1
- package/types/pc/pagination/PageOption.d.ts +1 -1
- package/types/pc/portal/Portal.d.ts +2 -6
- package/types/pc/portal/index.d.ts +2 -9
- package/types/pc/portal/interface.d.ts +14 -0
- package/types/pc/progress/CircleProgress.d.ts +1 -1
- package/types/pc/progress/LineProgess.d.ts +1 -1
- package/types/pc/progress/StepProgress.d.ts +1 -1
- package/types/pc/radio/Group.d.ts +2 -2
- package/types/pc/radio/GroupBlock.d.ts +1 -1
- package/types/pc/radio/Radio.d.ts +1 -1
- package/types/pc/resize-box/ResizeTrigger.d.ts +1 -1
- package/types/pc/result/403.d.ts +1 -1
- package/types/pc/result/404.d.ts +1 -1
- package/types/pc/result/500.d.ts +1 -1
- package/types/pc/segmented/interface.d.ts +6 -6
- package/types/pc/skeleton/Image.d.ts +1 -1
- package/types/pc/skeleton/Text.d.ts +2 -1
- package/types/pc/slider/Button.d.ts +1 -1
- package/types/pc/slider/Input.d.ts +1 -1
- package/types/pc/slider/Tick.d.ts +1 -1
- package/types/pc/space/index.d.ts +6 -5
- package/types/pc/speech-synthesis/index.d.ts +3 -1
- package/types/pc/speech-synthesis/interface.d.ts +7 -0
- package/types/pc/spin/DotLoading.d.ts +1 -1
- package/types/pc/splitter/SplitBar.d.ts +0 -1
- package/types/pc/splitter/hooks/useResizable.d.ts +0 -1
- package/types/pc/splitter/hooks/useResize.d.ts +1 -2
- package/types/pc/splitter/index.d.ts +5 -4
- package/types/pc/splitter/interface.d.ts +16 -24
- package/types/pc/suspense-fallback-test/index.d.ts +2 -3
- package/types/pc/suspense-fallback-test/interface.d.ts +2 -0
- package/types/pc/table/ColGroup.d.ts +1 -1
- package/types/pc/table/summary/Cell.d.ts +1 -1
- package/types/pc/table/summary/Row.d.ts +1 -1
- package/types/pc/table/tbody/Td.d.ts +1 -1
- package/types/pc/table/tbody/index.d.ts +1 -1
- package/types/pc/table/tfoot/index.d.ts +1 -1
- package/types/pc/table/th-resizable/index.d.ts +1 -1
- package/types/pc/table/thead/Column.d.ts +1 -1
- package/types/pc/table/thead/index.d.ts +1 -1
- package/types/pc/tabs/TabContent.d.ts +1 -1
- package/types/pc/tabs/tab-header/DropdownIcon.d.ts +1 -1
- package/types/pc/tabs/tab-header/TabInk.d.ts +1 -1
- package/types/pc/tabs/tab-header/TabNavIcon.d.ts +1 -1
- package/types/pc/time-picker/Picker.d.ts +1 -1
- package/types/pc/time-picker/RangePicker.d.ts +1 -1
- package/types/pc/time-picker/TimeColumn.d.ts +1 -1
- package/types/pc/time-picker/TimePicker.d.ts +1 -1
- package/types/pc/time-picker/index.d.ts +1 -1
- package/types/pc/tour/index.d.ts +1 -1
- package/types/pc/transfer/Item.d.ts +1 -1
- package/types/pc/transfer/List.d.ts +1 -1
- package/types/pc/tree/Animation.d.ts +1 -1
- package/types/pc/typography/Operations.d.ts +1 -1
- package/types/pc/upload/interface.d.ts +1 -0
- package/types/pc/upload/list/index.d.ts +1 -1
- package/types/pc/utils/constant.d.ts +1 -2
- package/types/pc/utils/dayjs.d.ts +2 -1
- package/types/pc/utils/index.d.ts +2 -5
- package/types/pc/utils/scrollIntoViewIfNeeded.d.ts +3 -0
- package/types/pc/utils/toArray.d.ts +1 -5
- package/types/pc/utils/tree.d.ts +2 -1
- package/types/pc/utils/tween.d.ts +1 -1
- package/types/pc/verification-code/VerificationCode.d.ts +1 -1
- package/types/pc/virtual-list/VirtualList.d.ts +2 -38
- package/types/pc/virtual-list/index.d.ts +2 -1
- package/types/pc/virtual-list/interface.d.ts +56 -0
- package/types/pc/watermark/Watermark.d.ts +1 -1
- package/typography/Ellipsis.js +5 -4
- package/typography/Operations.js +5 -4
- package/upload/request.js +12 -13
- package/upload/request_.js +2 -3
- package/utils/constant.js +5 -5
- package/utils/dayjs.js +13 -12
- package/utils/index.js +261 -284
- package/utils/scrollIntoViewIfNeeded.js +12 -0
- package/utils/toArray.js +3 -10
- package/utils/tree.js +11 -9
- package/utils/tween.js +5 -5
- package/version/index.js +1 -1
- package/virtual-list/interface.js +1 -0
- package/components/common/space/toArray.js +0 -11
- package/components/common/utils/convertToDurationBasedOnTimeUnits.js +0 -6
- package/dist/compute-scroll-into-view/src/index.js +0 -126
- package/dist/tinycolor/chunk/BOzCVdr0.js +0 -182
- package/dist/tinycolor/customize/index.js +0 -12
- package/dist/tinycolor/src/conversion.js +0 -143
- package/dist/tinycolor/src/css-color-names.js +0 -153
- package/dist/tinycolor/src/format-input.js +0 -77
- package/dist/tinycolor/src/index.js +0 -388
- package/dist/tinycolor/src/util.js +0 -32
- package/flex/utils.js +0 -13
- package/loading/style/index.module.less.js +0 -4
- package/types/common/space/toArray.d.ts +0 -3
- package/types/common/utils/convertToDurationBasedOnTimeUnits.d.ts +0 -3
- package/types/common/utils/scrollIntoView.d.ts +0 -4
- package/types/common/utils/tinycolor.d.ts +0 -1
- package/types/pc/flex/utils.d.ts +0 -9
- package/types/pc/suspense-fallback-test/style/index.d.ts +0 -1
- package/types/pc/utils/color.d.ts +0 -1
- package/types/pc/utils/computeScrollIntoView.d.ts +0 -1
- package/types/pc/utils/convertToDurationBasedOnTimeUnits.d.ts +0 -3
- package/types/pc/utils/scrollIntoView.d.ts +0 -3
- package/types/pc/utils/tinycolor.d.ts +0 -1
- package/utils/color.js +0 -4
- package/utils/computeScrollIntoView.js +0 -6
- package/utils/convertToDurationBasedOnTimeUnits.js +0 -6
- package/utils/scrollIntoView.js +0 -6
- package/utils/tinycolor.js +0 -29
- /package/{suspense-fallback-test/style/index.less.js → development/interface.js} +0 -0
package/anchor/util.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Tween as u } from "../dist/tween/src/tween.js";
|
|
2
|
-
import
|
|
2
|
+
import c from "../dist/tween/src/easing.js";
|
|
3
3
|
import i from "lodash/isString";
|
|
4
4
|
import { isWindow as l } from "../components/common/utils/is.js";
|
|
5
|
-
function
|
|
5
|
+
function d(o, n) {
|
|
6
6
|
const r = i(n) && n[0] === "#" ? `[id='${n.replace("#", "")}']` : n;
|
|
7
7
|
try {
|
|
8
8
|
return o.querySelector(r);
|
|
@@ -10,7 +10,7 @@ function s(o, n) {
|
|
|
10
10
|
return console.error(t), null;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function a(o, n, r) {
|
|
14
14
|
new u({
|
|
15
15
|
from: {
|
|
16
16
|
scrollTop: o.scrollTop
|
|
@@ -18,7 +18,7 @@ function w(o, n, r) {
|
|
|
18
18
|
to: {
|
|
19
19
|
scrollTop: n
|
|
20
20
|
},
|
|
21
|
-
easing: c,
|
|
21
|
+
easing: c.quartOut,
|
|
22
22
|
duration: 300,
|
|
23
23
|
onUpdate: (e) => {
|
|
24
24
|
o.scrollTop = e.scrollTop;
|
|
@@ -29,23 +29,23 @@ function w(o, n, r) {
|
|
|
29
29
|
}).start();
|
|
30
30
|
}
|
|
31
31
|
function g(o) {
|
|
32
|
-
return i(o) ?
|
|
32
|
+
return i(o) ? d(document, o) : o || window;
|
|
33
33
|
}
|
|
34
34
|
function S(o) {
|
|
35
35
|
return l(o) ? document.documentElement || document.body : o;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function s(o) {
|
|
38
38
|
if (o == null)
|
|
39
39
|
return null;
|
|
40
40
|
if (o.tagName === "BODY")
|
|
41
41
|
return o.ownerDocument.documentElement;
|
|
42
42
|
const n = window.getComputedStyle(o).overflowY;
|
|
43
|
-
return n !== "visible" && n !== "hidden" && o.scrollHeight > o.clientHeight ? o :
|
|
43
|
+
return n !== "visible" && n !== "hidden" && o.scrollHeight > o.clientHeight ? o : s(o.parentElement);
|
|
44
44
|
}
|
|
45
45
|
export {
|
|
46
|
-
|
|
46
|
+
d as findNode,
|
|
47
47
|
g as getContainer,
|
|
48
48
|
S as getContainerElement,
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
s as getScrollParent,
|
|
50
|
+
a as slide
|
|
51
51
|
};
|
package/back-top/index.js
CHANGED
|
@@ -1,41 +1,40 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import C from "@unicom-cloud/icons/IconUiToTop";
|
|
3
3
|
import { Tween as v } from "../dist/tween/src/tween.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import x from "../dist/tween/src/easing.js";
|
|
5
|
+
import k, { forwardRef as y, useContext as B, useState as E, useEffect as N } from "react";
|
|
6
6
|
import "../config-provider/ConfigProvider.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { PqbCSSTransition as
|
|
10
|
-
import
|
|
11
|
-
import { on as $, off as
|
|
12
|
-
import { pickDataAttributes as
|
|
13
|
-
import { throttleByRaf as
|
|
14
|
-
import
|
|
15
|
-
function
|
|
16
|
-
i ||= B();
|
|
7
|
+
import H from "../components/common/hooks/useKeyboardEvent.js";
|
|
8
|
+
import P from "../components/common/hooks/useMergeProps.js";
|
|
9
|
+
import { PqbCSSTransition as R } from "../components/common/utils/PqbCSSTransition.js";
|
|
10
|
+
import S from "@unicom-cloud/utils/class-name";
|
|
11
|
+
import { on as $, off as q } from "../components/common/utils/dom.js";
|
|
12
|
+
import { pickDataAttributes as D } from "../components/common/utils/pick.js";
|
|
13
|
+
import { throttleByRaf as I } from "../components/common/utils/throttleByRaf.js";
|
|
14
|
+
import K from "../config-provider/context.js";
|
|
15
|
+
function O(m, p) {
|
|
17
16
|
const f = {
|
|
18
17
|
visibleHeight: 400,
|
|
19
18
|
tween: !0,
|
|
20
|
-
easing:
|
|
19
|
+
easing: x.quartOut,
|
|
21
20
|
duration: 400,
|
|
22
21
|
target: () => window
|
|
23
|
-
}, { getPrefixCls: u, componentConfig: d, rtl: g } =
|
|
24
|
-
|
|
22
|
+
}, { getPrefixCls: u, componentConfig: d, rtl: g } = B(K), T = H(), o = P(
|
|
23
|
+
m,
|
|
25
24
|
f,
|
|
26
25
|
d?.BackTop
|
|
27
|
-
), s = u?.("backtop"), [b, w] =
|
|
28
|
-
|
|
29
|
-
const e = o.target?.(), t =
|
|
30
|
-
const n = o.visibleHeight,
|
|
31
|
-
w(
|
|
26
|
+
), s = u?.("backtop"), [b, w] = E(!1), i = (e) => e === window ? document.documentElement : e;
|
|
27
|
+
N(() => {
|
|
28
|
+
const e = o.target?.(), t = I(() => {
|
|
29
|
+
const n = o.visibleHeight, c = i(e).scrollTop;
|
|
30
|
+
w(c >= n);
|
|
32
31
|
});
|
|
33
32
|
return $(e, "scroll", t), t(), () => {
|
|
34
|
-
t.cancel?.(),
|
|
33
|
+
t.cancel?.(), q(e, "scroll", t);
|
|
35
34
|
};
|
|
36
35
|
}, [o.target, o.visibleHeight]);
|
|
37
|
-
const
|
|
38
|
-
const e = o.target?.(), t =
|
|
36
|
+
const l = () => {
|
|
37
|
+
const e = o.target?.(), t = i(e), n = t.scrollTop;
|
|
39
38
|
window.getComputedStyle(t)?.scrollBehavior === "smooth" || o.tween === !1 ? t.scrollTo(0, 0) : new v({
|
|
40
39
|
from: { scrollTop: n },
|
|
41
40
|
to: { scrollTop: 0 },
|
|
@@ -49,20 +48,20 @@ function U(p, i) {
|
|
|
49
48
|
return /* @__PURE__ */ r(
|
|
50
49
|
"div",
|
|
51
50
|
{
|
|
52
|
-
...
|
|
53
|
-
ref:
|
|
54
|
-
className:
|
|
51
|
+
...D(o),
|
|
52
|
+
ref: p,
|
|
53
|
+
className: S(
|
|
55
54
|
`${s}`,
|
|
56
55
|
{ [`${s}-rtl`]: g },
|
|
57
56
|
o.className
|
|
58
57
|
),
|
|
59
58
|
style: o.style,
|
|
60
|
-
onClick:
|
|
59
|
+
onClick: l,
|
|
61
60
|
...T({
|
|
62
|
-
onPressEnter:
|
|
61
|
+
onPressEnter: l
|
|
63
62
|
}),
|
|
64
63
|
children: /* @__PURE__ */ r(
|
|
65
|
-
|
|
64
|
+
R,
|
|
66
65
|
{
|
|
67
66
|
in: b,
|
|
68
67
|
timeout: 100,
|
|
@@ -74,11 +73,11 @@ function U(p, i) {
|
|
|
74
73
|
}
|
|
75
74
|
);
|
|
76
75
|
}
|
|
77
|
-
const
|
|
78
|
-
|
|
76
|
+
const a = y(
|
|
77
|
+
O
|
|
79
78
|
);
|
|
80
|
-
|
|
81
|
-
const
|
|
79
|
+
a.displayName = "BackTop";
|
|
80
|
+
const Z = k.memo(a);
|
|
82
81
|
export {
|
|
83
|
-
|
|
82
|
+
Z as default
|
|
84
83
|
};
|
package/badge/index.js
CHANGED
|
@@ -1,58 +1,11 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as d, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import _ from "lodash/isPlainObject";
|
|
3
|
+
import { forwardRef as q, useContext as z, useRef as H, useImperativeHandle as L } from "react";
|
|
4
4
|
import "../config-provider/ConfigProvider.js";
|
|
5
|
-
import
|
|
6
|
-
import "
|
|
7
|
-
import
|
|
8
|
-
import "
|
|
9
|
-
import "@unicom-cloud/utils/constant/ui";
|
|
10
|
-
import "../utils/contextHolder.js";
|
|
11
|
-
import "@unicom-cloud/utils/dayjs";
|
|
12
|
-
import "@unicom-cloud/utils/clipboard-copy";
|
|
13
|
-
import "../components/common/utils/dayjs.js";
|
|
14
|
-
import "../components/common/utils/dom.js";
|
|
15
|
-
import "@unicom-cloud/utils/file/fileToURL";
|
|
16
|
-
import "lodash/escapeRegExp";
|
|
17
|
-
import "lodash/isArray";
|
|
18
|
-
import "lodash/isNumber";
|
|
19
|
-
import "lodash/isString";
|
|
20
|
-
import "lodash/isFunction";
|
|
21
|
-
import "lodash/throttle";
|
|
22
|
-
import "../components/common/utils/is.js";
|
|
23
|
-
import "lodash/camelCase";
|
|
24
|
-
import "lodash/capitalize";
|
|
25
|
-
import "lodash/cloneDeep";
|
|
26
|
-
import "lodash/debounce";
|
|
27
|
-
import "lodash/get";
|
|
28
|
-
import "lodash/has";
|
|
29
|
-
import "lodash/kebabCase";
|
|
30
|
-
import "lodash/merge";
|
|
31
|
-
import "lodash/mergeWith";
|
|
32
|
-
import "lodash/set";
|
|
33
|
-
import "lodash/setWith";
|
|
34
|
-
import "lodash/snakeCase";
|
|
35
|
-
import "lodash/startCase";
|
|
36
|
-
import "lodash/uniq";
|
|
37
|
-
import "lodash/upperFirst";
|
|
38
|
-
import "@unicom-cloud/utils/math";
|
|
39
|
-
import { PqbCSSTransition as U } from "../components/common/utils/PqbCSSTransition.js";
|
|
40
|
-
import "../components/common/utils/reactDOM.js";
|
|
41
|
-
import "../dist/react-transition-group/src/CSSTransition.js";
|
|
42
|
-
import "../dist/react-transition-group/src/ReplaceTransition.js";
|
|
43
|
-
import "../dist/react-transition-group/src/SwitchTransition.js";
|
|
44
|
-
import "../dist/react-transition-group/chunk/CPfP7aNL.js";
|
|
45
|
-
import "../dist/react-transition-group/src/TransitionGroup.js";
|
|
46
|
-
import "@unicom-cloud/utils/file/saveAs";
|
|
47
|
-
import "@unicom-cloud/utils/screenfull";
|
|
48
|
-
import "@unicom-cloud/utils/constant/ui.js";
|
|
49
|
-
import "react-is";
|
|
50
|
-
import "@unicom-cloud/utils/tree";
|
|
51
|
-
import "@unicom-cloud/utils/is";
|
|
52
|
-
import { v4 as F } from "uuid";
|
|
53
|
-
import "../dist/validate/src/index.js";
|
|
54
|
-
import "@unicom-cloud/utils/constant/keyboardCode";
|
|
55
|
-
import B from "./Count.js";
|
|
5
|
+
import U from "../components/common/hooks/useMergeProps.js";
|
|
6
|
+
import { PqbCSSTransition as F } from "../components/common/utils/PqbCSSTransition.js";
|
|
7
|
+
import l from "@unicom-cloud/utils/class-name";
|
|
8
|
+
import h from "./Count.js";
|
|
56
9
|
import J from "../config-provider/context.js";
|
|
57
10
|
const f = [
|
|
58
11
|
"red",
|
|
@@ -72,164 +25,158 @@ const f = [
|
|
|
72
25
|
dotAnimation: !0
|
|
73
26
|
// 默认开启 dot 动画
|
|
74
27
|
};
|
|
75
|
-
function Q(
|
|
76
|
-
const { getPrefixCls:
|
|
77
|
-
|
|
28
|
+
function Q(O, B) {
|
|
29
|
+
const { getPrefixCls: D, componentConfig: P, rtl: $ } = z(J), R = U(
|
|
30
|
+
O,
|
|
78
31
|
K,
|
|
79
|
-
|
|
32
|
+
P?.Badge
|
|
80
33
|
), {
|
|
81
|
-
ribbon:
|
|
82
|
-
count:
|
|
83
|
-
prefixText:
|
|
84
|
-
text:
|
|
85
|
-
className:
|
|
86
|
-
dotClassName:
|
|
87
|
-
dot:
|
|
88
|
-
dotAnimation:
|
|
89
|
-
maxCount:
|
|
90
|
-
color:
|
|
91
|
-
dotStyle:
|
|
92
|
-
offset:
|
|
93
|
-
style:
|
|
94
|
-
status:
|
|
95
|
-
children:
|
|
96
|
-
...
|
|
97
|
-
} =
|
|
98
|
-
|
|
99
|
-
dom:
|
|
34
|
+
ribbon: s,
|
|
35
|
+
count: n,
|
|
36
|
+
prefixText: b,
|
|
37
|
+
text: u,
|
|
38
|
+
className: A,
|
|
39
|
+
dotClassName: i,
|
|
40
|
+
dot: g,
|
|
41
|
+
dotAnimation: C,
|
|
42
|
+
maxCount: T,
|
|
43
|
+
color: t,
|
|
44
|
+
dotStyle: w,
|
|
45
|
+
offset: E,
|
|
46
|
+
style: j,
|
|
47
|
+
status: m,
|
|
48
|
+
children: N,
|
|
49
|
+
...v
|
|
50
|
+
} = R, p = H(null), e = D?.("badge"), a = { ...w || {} }, [x, y] = E || [];
|
|
51
|
+
x && (a.marginRight = -x), y && (a.marginTop = y), L(B, () => ({
|
|
52
|
+
dom: p.current,
|
|
53
|
+
getRootDOMNode() {
|
|
54
|
+
return p.current;
|
|
55
|
+
}
|
|
100
56
|
}));
|
|
101
57
|
const k = () => {
|
|
102
|
-
if (
|
|
103
|
-
return /* @__PURE__ */
|
|
58
|
+
if (_(n))
|
|
59
|
+
return /* @__PURE__ */ o(
|
|
104
60
|
"span",
|
|
105
61
|
{
|
|
106
|
-
className:
|
|
107
|
-
style:
|
|
108
|
-
children:
|
|
62
|
+
className: l(`${e}-custom-dot`, i),
|
|
63
|
+
style: a,
|
|
64
|
+
children: n
|
|
109
65
|
}
|
|
110
66
|
);
|
|
111
|
-
const
|
|
112
|
-
return
|
|
67
|
+
const r = t ? f.includes(t) : !1, c = !t || r ? {} : { backgroundColor: t };
|
|
68
|
+
return u && !t && !m ? /* @__PURE__ */ o(
|
|
113
69
|
"span",
|
|
114
70
|
{
|
|
115
|
-
className:
|
|
116
|
-
style:
|
|
117
|
-
children:
|
|
71
|
+
className: l(`${e}-text`, i),
|
|
72
|
+
style: a,
|
|
73
|
+
children: u
|
|
118
74
|
}
|
|
119
|
-
) :
|
|
120
|
-
!!
|
|
121
|
-
/* @__PURE__ */
|
|
75
|
+
) : m || t && typeof n == "number" && n <= 0 ? /* @__PURE__ */ d("span", { className: `${e}-status-wrapper`, children: [
|
|
76
|
+
!!b && /* @__PURE__ */ o("span", { className: `${e}-status-prefix-text`, children: b }),
|
|
77
|
+
/* @__PURE__ */ o(
|
|
122
78
|
"span",
|
|
123
79
|
{
|
|
124
|
-
|
|
125
|
-
|
|
80
|
+
style: { ...c, ...a },
|
|
81
|
+
className: l(
|
|
82
|
+
`${e}-status-dot`,
|
|
126
83
|
{
|
|
127
|
-
[`${
|
|
128
|
-
[`${
|
|
129
|
-
[`${
|
|
84
|
+
[`${e}-dot-pulse`]: C,
|
|
85
|
+
[`${e}-status-${m}`]: m,
|
|
86
|
+
[`${e}-color-${t}`]: t && r
|
|
130
87
|
},
|
|
131
|
-
|
|
132
|
-
)
|
|
133
|
-
style: { ...a, ...i }
|
|
88
|
+
i
|
|
89
|
+
)
|
|
134
90
|
}
|
|
135
91
|
),
|
|
136
|
-
!!
|
|
137
|
-
] }) : (
|
|
138
|
-
|
|
92
|
+
!!u && /* @__PURE__ */ o("span", { className: `${e}-status-text`, children: u })
|
|
93
|
+
] }) : (g || t) && typeof n == "number" && n > 0 ? /* @__PURE__ */ o(
|
|
94
|
+
F,
|
|
139
95
|
{
|
|
140
96
|
classNames: "badge-zoom",
|
|
141
|
-
in:
|
|
97
|
+
in: g || !!t,
|
|
142
98
|
timeout: 200,
|
|
143
99
|
appear: !0,
|
|
144
100
|
mountOnEnter: !0,
|
|
145
101
|
unmountOnExit: !0,
|
|
146
|
-
children: /* @__PURE__ */
|
|
102
|
+
children: /* @__PURE__ */ o(
|
|
147
103
|
"span",
|
|
148
104
|
{
|
|
149
|
-
className:
|
|
150
|
-
`${
|
|
105
|
+
className: l(
|
|
106
|
+
`${e}-dot`,
|
|
151
107
|
{
|
|
152
|
-
[`${
|
|
153
|
-
[`${
|
|
108
|
+
[`${e}-dot-pulse`]: C,
|
|
109
|
+
[`${e}-color-${t}`]: t && r
|
|
154
110
|
},
|
|
155
|
-
|
|
111
|
+
i
|
|
156
112
|
),
|
|
157
|
-
style: { ...
|
|
113
|
+
style: { ...c, ...a }
|
|
158
114
|
}
|
|
159
115
|
)
|
|
160
116
|
}
|
|
161
|
-
) : /* @__PURE__ */
|
|
162
|
-
|
|
117
|
+
) : /* @__PURE__ */ o(
|
|
118
|
+
h,
|
|
163
119
|
{
|
|
164
|
-
prefixCls:
|
|
165
|
-
className:
|
|
166
|
-
style: { ...
|
|
167
|
-
maxCount:
|
|
168
|
-
count:
|
|
120
|
+
prefixCls: e,
|
|
121
|
+
className: l(`${e}-number`, i),
|
|
122
|
+
style: { ...c, ...a },
|
|
123
|
+
maxCount: T,
|
|
124
|
+
count: n
|
|
169
125
|
}
|
|
170
126
|
);
|
|
171
127
|
}, G = () => {
|
|
172
|
-
if (!
|
|
173
|
-
const
|
|
174
|
-
|
|
128
|
+
if (!s) return;
|
|
129
|
+
const r = s.color, c = r ? f.includes(r) : !1, I = {
|
|
130
|
+
...c ? {} : { backgroundColor: r },
|
|
131
|
+
...s.style
|
|
132
|
+
}, M = s.placement || "end";
|
|
133
|
+
return /* @__PURE__ */ d(
|
|
175
134
|
"div",
|
|
176
135
|
{
|
|
177
|
-
className:
|
|
178
|
-
`${
|
|
179
|
-
`${
|
|
136
|
+
className: l(
|
|
137
|
+
`${e}-ribbon`,
|
|
138
|
+
`${e}-ribbon-${M}`,
|
|
180
139
|
{
|
|
181
|
-
[`${
|
|
182
|
-
[`${
|
|
183
|
-
}
|
|
140
|
+
[`${e}-rtl`]: $,
|
|
141
|
+
[`${e}-color-${r}`]: r && c
|
|
142
|
+
},
|
|
143
|
+
s.className
|
|
184
144
|
),
|
|
185
|
-
style:
|
|
145
|
+
style: I,
|
|
186
146
|
children: [
|
|
187
|
-
/* @__PURE__ */
|
|
188
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ o("span", { className: `${e}-ribbon-text`, children: s.text }),
|
|
148
|
+
/* @__PURE__ */ o("div", { className: `${e}-ribbon-corner` })
|
|
189
149
|
]
|
|
190
150
|
}
|
|
191
151
|
);
|
|
192
152
|
};
|
|
193
|
-
return
|
|
194
|
-
"div",
|
|
195
|
-
{
|
|
196
|
-
className: `${t}-ribbon-wrapper`,
|
|
197
|
-
ref: d,
|
|
198
|
-
style: N,
|
|
199
|
-
id: C.current,
|
|
200
|
-
...y,
|
|
201
|
-
children: [
|
|
202
|
-
u,
|
|
203
|
-
G()
|
|
204
|
-
]
|
|
205
|
-
}
|
|
206
|
-
) : /* @__PURE__ */ c(
|
|
153
|
+
return /* @__PURE__ */ d(
|
|
207
154
|
"span",
|
|
208
155
|
{
|
|
209
|
-
className:
|
|
210
|
-
|
|
156
|
+
className: l(
|
|
157
|
+
e,
|
|
211
158
|
{
|
|
212
|
-
[`${
|
|
213
|
-
[`${
|
|
214
|
-
[`${
|
|
159
|
+
[`${e}-status`]: m,
|
|
160
|
+
[`${e}-no-children`]: !N,
|
|
161
|
+
[`${e}-rtl`]: $
|
|
215
162
|
},
|
|
216
|
-
|
|
163
|
+
!!s && `${e}-ribbon-wrapper`,
|
|
164
|
+
A
|
|
217
165
|
),
|
|
218
|
-
ref:
|
|
219
|
-
style:
|
|
220
|
-
|
|
221
|
-
...y,
|
|
166
|
+
ref: p,
|
|
167
|
+
style: j,
|
|
168
|
+
...v,
|
|
222
169
|
children: [
|
|
223
|
-
|
|
224
|
-
k()
|
|
170
|
+
N,
|
|
171
|
+
s ? G() : k()
|
|
225
172
|
]
|
|
226
173
|
}
|
|
227
174
|
);
|
|
228
175
|
}
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
const
|
|
176
|
+
const S = q(Q);
|
|
177
|
+
S.displayName = "Badge";
|
|
178
|
+
S.Count = h;
|
|
179
|
+
const se = f, ne = [
|
|
233
180
|
"default",
|
|
234
181
|
"processing",
|
|
235
182
|
"success",
|
|
@@ -237,8 +184,8 @@ const Xt = f, Yt = [
|
|
|
237
184
|
"error"
|
|
238
185
|
];
|
|
239
186
|
export {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
187
|
+
se as BADGE_COLORS,
|
|
188
|
+
ne as BADGE_STATUS,
|
|
189
|
+
h as BadgeCount,
|
|
190
|
+
S as default
|
|
244
191
|
};
|