@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/avatar/Avatar.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as W, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import j from "lodash/isNumber";
|
|
3
|
+
import x, { forwardRef as E, useContext as y, useRef as C, useImperativeHandle as H, useEffect as T } from "react";
|
|
4
4
|
import "../config-provider/ConfigProvider.js";
|
|
5
5
|
import D from "@unicom-cloud/utils/class-name";
|
|
6
6
|
import L from "./context.js";
|
|
@@ -9,68 +9,68 @@ const O = {
|
|
|
9
9
|
shape: "circle",
|
|
10
10
|
autoFixFontSize: !0,
|
|
11
11
|
triggerType: "button"
|
|
12
|
-
}, V =
|
|
13
|
-
(i,
|
|
14
|
-
const { getPrefixCls:
|
|
12
|
+
}, V = E(
|
|
13
|
+
(i, N) => {
|
|
14
|
+
const { getPrefixCls: $, componentConfig: v, rtl: z } = y(M), t = $?.("avatar"), f = y(L), F = {
|
|
15
15
|
...O,
|
|
16
|
-
...
|
|
17
|
-
...
|
|
16
|
+
...v?.Avatar,
|
|
17
|
+
...f,
|
|
18
18
|
...i
|
|
19
19
|
}, {
|
|
20
20
|
className: R,
|
|
21
21
|
shape: S,
|
|
22
22
|
size: e,
|
|
23
|
-
children:
|
|
23
|
+
children: r,
|
|
24
24
|
autoFixFontSize: b,
|
|
25
|
-
triggerIcon:
|
|
26
|
-
triggerIconStyle:
|
|
25
|
+
triggerIcon: a,
|
|
26
|
+
triggerIconStyle: o,
|
|
27
27
|
triggerType: g,
|
|
28
28
|
onClick: A,
|
|
29
29
|
...I
|
|
30
|
-
} = F,
|
|
31
|
-
function
|
|
32
|
-
if (
|
|
33
|
-
const
|
|
34
|
-
|
|
30
|
+
} = F, c = { ...f.style, ...i.style }, s = C(), l = C();
|
|
31
|
+
function P() {
|
|
32
|
+
if (s.current) {
|
|
33
|
+
const w = s.current.clientWidth, p = i.size || l.current.offsetWidth, h = p / (w + 8);
|
|
34
|
+
p && h < 1 && (s.current.style.transform = `scale(${h}) translateX(-50%)`);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
const
|
|
37
|
+
const k = D(
|
|
38
38
|
t,
|
|
39
39
|
`${t}-${S}`,
|
|
40
40
|
{
|
|
41
|
-
[`${t}-with-trigger-icon`]:
|
|
42
|
-
[`${t}-rtl`]:
|
|
41
|
+
[`${t}-with-trigger-icon`]: a,
|
|
42
|
+
[`${t}-rtl`]: z
|
|
43
43
|
},
|
|
44
44
|
R
|
|
45
|
-
), n =
|
|
46
|
-
return g === "button" && (!
|
|
45
|
+
), n = x.Children.toArray(r), u = n.length === 1 && x.isValidElement(n[0]) && (n[0].type === "img" || n[0].type === "picture"), d = o || {};
|
|
46
|
+
return g === "button" && (!o || o && !o.color) && c?.backgroundColor && (d.color = c.backgroundColor), H(N, () => ({
|
|
47
47
|
getRootDOMNode() {
|
|
48
|
-
return
|
|
48
|
+
return l.current;
|
|
49
49
|
}
|
|
50
50
|
})), T(() => {
|
|
51
|
-
b &&
|
|
52
|
-
}, [e,
|
|
51
|
+
b && P();
|
|
52
|
+
}, [e, r]), /* @__PURE__ */ W(
|
|
53
53
|
"div",
|
|
54
54
|
{
|
|
55
|
-
ref:
|
|
55
|
+
ref: l,
|
|
56
56
|
onClick: A,
|
|
57
57
|
...I,
|
|
58
58
|
style: {
|
|
59
59
|
width: e,
|
|
60
60
|
height: e,
|
|
61
|
-
fontSize:
|
|
62
|
-
...
|
|
61
|
+
fontSize: j(e) ? e / 2 : "",
|
|
62
|
+
...c
|
|
63
63
|
},
|
|
64
|
-
className:
|
|
64
|
+
className: k,
|
|
65
65
|
children: [
|
|
66
|
-
|
|
67
|
-
!
|
|
68
|
-
|
|
66
|
+
u ? /* @__PURE__ */ m("span", { className: `${t}-image`, children: r }) : null,
|
|
67
|
+
!u && /* @__PURE__ */ m("span", { ref: s, className: `${t}-text`, children: r }),
|
|
68
|
+
a && /* @__PURE__ */ m(
|
|
69
69
|
"div",
|
|
70
70
|
{
|
|
71
71
|
className: `${t}-trigger-icon-${g}`,
|
|
72
|
-
style:
|
|
73
|
-
children:
|
|
72
|
+
style: d,
|
|
73
|
+
children: a
|
|
74
74
|
}
|
|
75
75
|
)
|
|
76
76
|
]
|
package/avatar/Group.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t, jsxs as _ } from "react/jsx-runtime";
|
|
2
2
|
import $ from "lodash/isNumber";
|
|
3
3
|
import I, { forwardRef as R, useContext as b } from "react";
|
|
4
4
|
import "../config-provider/ConfigProvider.js";
|
|
@@ -6,50 +6,50 @@ import j from "../components/common/hooks/useMergeProps.js";
|
|
|
6
6
|
import T from "../popover/index.js";
|
|
7
7
|
import k from "@unicom-cloud/utils/class-name";
|
|
8
8
|
import q from "./Avatar.js";
|
|
9
|
-
import
|
|
9
|
+
import u from "./context.js";
|
|
10
10
|
import w from "../config-provider/context.js";
|
|
11
11
|
const L = {
|
|
12
12
|
shape: "circle",
|
|
13
13
|
autoFixFontSize: !0
|
|
14
14
|
};
|
|
15
|
-
function M(
|
|
16
|
-
const { getPrefixCls:
|
|
17
|
-
|
|
15
|
+
function M(v, f) {
|
|
16
|
+
const { getPrefixCls: d, componentConfig: h, rtl: i } = b(w), g = j(
|
|
17
|
+
v,
|
|
18
18
|
L,
|
|
19
|
-
|
|
19
|
+
h?.["Avatar.Group"]
|
|
20
20
|
), {
|
|
21
21
|
className: x,
|
|
22
|
-
style:
|
|
23
|
-
children:
|
|
22
|
+
style: C,
|
|
23
|
+
children: P,
|
|
24
24
|
size: e,
|
|
25
|
-
shape:
|
|
26
|
-
autoFixFontSize:
|
|
27
|
-
zIndexAscend:
|
|
25
|
+
shape: c,
|
|
26
|
+
autoFixFontSize: l,
|
|
27
|
+
zIndexAscend: N,
|
|
28
28
|
maxCount: r,
|
|
29
|
-
maxStyle:
|
|
29
|
+
maxStyle: A,
|
|
30
30
|
maxPopoverTriggerProps: y,
|
|
31
31
|
...z
|
|
32
|
-
} = g, a =
|
|
32
|
+
} = g, a = d?.("avatar-group"), F = k(
|
|
33
33
|
a,
|
|
34
34
|
{
|
|
35
|
-
[`${a}-rtl`]:
|
|
35
|
+
[`${a}-rtl`]: i
|
|
36
36
|
},
|
|
37
37
|
x
|
|
38
|
-
), s = I.Children.toArray(
|
|
38
|
+
), s = I.Children.toArray(P), m = s.length;
|
|
39
39
|
let n = s;
|
|
40
|
-
if ($(r) && r >= 0 &&
|
|
40
|
+
if ($(r) && r >= 0 && m > r) {
|
|
41
41
|
const p = s.slice(r);
|
|
42
42
|
n = s.slice(0, r), n.push(
|
|
43
|
-
/* @__PURE__ */
|
|
43
|
+
/* @__PURE__ */ t(
|
|
44
44
|
q,
|
|
45
45
|
{
|
|
46
|
-
style:
|
|
46
|
+
style: A,
|
|
47
47
|
className: `${a}-max-count-avatar`,
|
|
48
48
|
children: /* @__PURE__ */ _(
|
|
49
49
|
T,
|
|
50
50
|
{
|
|
51
51
|
triggerProps: y,
|
|
52
|
-
content: /* @__PURE__ */
|
|
52
|
+
content: /* @__PURE__ */ t(u.Provider, { value: { size: e, shape: c, autoFixFontSize: l }, children: /* @__PURE__ */ t("div", { className: `${a}-popover`, children: p }) }),
|
|
53
53
|
children: [
|
|
54
54
|
"+",
|
|
55
55
|
p.length
|
|
@@ -61,18 +61,18 @@ function M(f, h) {
|
|
|
61
61
|
)
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
const G =
|
|
66
|
-
zIndex:
|
|
64
|
+
return /* @__PURE__ */ t("div", { ref: f, style: C, className: F, ...z, children: n.map((p, o) => {
|
|
65
|
+
const G = i ? o === n.length - 1 : o === 0, S = {
|
|
66
|
+
zIndex: N ? o + 1 : m - o,
|
|
67
67
|
marginLeft: e ? G ? 0 : -e / 4 : ""
|
|
68
68
|
};
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
|
|
69
|
+
return /* @__PURE__ */ t(
|
|
70
|
+
u.Provider,
|
|
71
71
|
{
|
|
72
|
-
value: { size: e, shape:
|
|
72
|
+
value: { size: e, shape: c, autoFixFontSize: l, style: S },
|
|
73
73
|
children: p
|
|
74
74
|
},
|
|
75
|
-
|
|
75
|
+
o
|
|
76
76
|
);
|
|
77
77
|
}) });
|
|
78
78
|
}
|
package/back-top/index.js
CHANGED
|
@@ -1,87 +1,84 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { Tween as
|
|
4
|
-
import { quartOut as
|
|
5
|
-
import
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import C from "@unicom-cloud/icons/IconUiToTop";
|
|
3
|
+
import { Tween as v } from "../dist/tween/src/tween.js";
|
|
4
|
+
import { quartOut as k } from "../dist/tween/src/easing.js";
|
|
5
|
+
import x, { forwardRef as y, useRef as B, useContext as E, useState as N, useEffect as H } from "react";
|
|
6
6
|
import "../config-provider/ConfigProvider.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { PqbCSSTransition as
|
|
10
|
-
import
|
|
11
|
-
import { on as
|
|
12
|
-
import { pickDataAttributes as
|
|
13
|
-
import { throttleByRaf as
|
|
14
|
-
import
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
const
|
|
7
|
+
import P from "../components/common/hooks/useKeyboardEvent.js";
|
|
8
|
+
import R from "../components/common/hooks/useMergeProps.js";
|
|
9
|
+
import { PqbCSSTransition as S } from "../components/common/utils/PqbCSSTransition.js";
|
|
10
|
+
import q from "@unicom-cloud/utils/class-name";
|
|
11
|
+
import { on as $, off as D } from "../components/common/utils/dom.js";
|
|
12
|
+
import { pickDataAttributes as I } from "../components/common/utils/pick.js";
|
|
13
|
+
import { throttleByRaf as K } from "../components/common/utils/throttleByRaf.js";
|
|
14
|
+
import O from "../config-provider/context.js";
|
|
15
|
+
function U(p, i) {
|
|
16
|
+
i ||= B();
|
|
17
|
+
const f = {
|
|
18
18
|
visibleHeight: 400,
|
|
19
19
|
tween: !0,
|
|
20
|
-
easing:
|
|
20
|
+
easing: k,
|
|
21
21
|
duration: 400,
|
|
22
22
|
target: () => window
|
|
23
|
-
}, { getPrefixCls:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
v(n >= r);
|
|
23
|
+
}, { getPrefixCls: u, componentConfig: d, rtl: g } = E(O), T = P(), o = R(
|
|
24
|
+
p,
|
|
25
|
+
f,
|
|
26
|
+
d?.BackTop
|
|
27
|
+
), s = u?.("backtop"), [b, w] = N(!1), l = (e) => e === window ? document.documentElement : e;
|
|
28
|
+
H(() => {
|
|
29
|
+
const e = o.target?.(), t = K(() => {
|
|
30
|
+
const n = o.visibleHeight, a = l(e).scrollTop;
|
|
31
|
+
w(a >= n);
|
|
33
32
|
});
|
|
34
|
-
return
|
|
35
|
-
|
|
36
|
-
(r = o.cancel) == null || r.call(o), K(e, "scroll", o);
|
|
33
|
+
return $(e, "scroll", t), t(), () => {
|
|
34
|
+
t.cancel?.(), D(e, "scroll", t);
|
|
37
35
|
};
|
|
38
|
-
}, [
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
from: { scrollTop: s },
|
|
36
|
+
}, [o.target, o.visibleHeight]);
|
|
37
|
+
const c = () => {
|
|
38
|
+
const e = o.target?.(), t = l(e), n = t.scrollTop;
|
|
39
|
+
window.getComputedStyle(t)?.scrollBehavior === "smooth" || o.tween === !1 ? t.scrollTo(0, 0) : new v({
|
|
40
|
+
from: { scrollTop: n },
|
|
44
41
|
to: { scrollTop: 0 },
|
|
45
|
-
easing:
|
|
46
|
-
duration:
|
|
47
|
-
onUpdate: (
|
|
48
|
-
|
|
42
|
+
easing: o.easing,
|
|
43
|
+
duration: o.duration,
|
|
44
|
+
onUpdate: (h) => {
|
|
45
|
+
t.scrollTop = h.scrollTop;
|
|
49
46
|
}
|
|
50
|
-
}).start(),
|
|
47
|
+
}).start(), o.onClick?.();
|
|
51
48
|
};
|
|
52
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ r(
|
|
53
50
|
"div",
|
|
54
51
|
{
|
|
55
|
-
...
|
|
56
|
-
ref:
|
|
57
|
-
className:
|
|
58
|
-
`${
|
|
59
|
-
{ [`${
|
|
60
|
-
|
|
52
|
+
...I(o),
|
|
53
|
+
ref: i,
|
|
54
|
+
className: q(
|
|
55
|
+
`${s}`,
|
|
56
|
+
{ [`${s}-rtl`]: g },
|
|
57
|
+
o.className
|
|
61
58
|
),
|
|
62
|
-
style:
|
|
63
|
-
onClick:
|
|
64
|
-
...
|
|
65
|
-
onPressEnter:
|
|
59
|
+
style: o.style,
|
|
60
|
+
onClick: c,
|
|
61
|
+
...T({
|
|
62
|
+
onPressEnter: c
|
|
66
63
|
}),
|
|
67
|
-
children: /* @__PURE__ */
|
|
68
|
-
|
|
64
|
+
children: /* @__PURE__ */ r(
|
|
65
|
+
S,
|
|
69
66
|
{
|
|
70
|
-
in:
|
|
67
|
+
in: b,
|
|
71
68
|
timeout: 100,
|
|
72
69
|
classNames: "fadeIn",
|
|
73
70
|
unmountOnExit: !0,
|
|
74
|
-
children:
|
|
71
|
+
children: o.children || /* @__PURE__ */ r("button", { className: `${s}-button`, children: /* @__PURE__ */ r(C, {}) })
|
|
75
72
|
}
|
|
76
73
|
)
|
|
77
74
|
}
|
|
78
75
|
);
|
|
79
76
|
}
|
|
80
|
-
const
|
|
81
|
-
|
|
77
|
+
const m = y(
|
|
78
|
+
U
|
|
82
79
|
);
|
|
83
|
-
|
|
84
|
-
const
|
|
80
|
+
m.displayName = "BackTop";
|
|
81
|
+
const _ = x.memo(m);
|
|
85
82
|
export {
|
|
86
|
-
|
|
83
|
+
_ as default
|
|
87
84
|
};
|
package/badge/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as g, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import R from "lodash/isPlainObject";
|
|
3
3
|
import { forwardRef as G, useContext as _ } from "react";
|
|
4
4
|
import "../config-provider/ConfigProvider.js";
|
|
5
5
|
import k from "../components/common/hooks/useMergeProps.js";
|
|
6
6
|
import { PqbCSSTransition as q } from "../components/common/utils/PqbCSSTransition.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
7
|
+
import n from "@unicom-cloud/utils/class-name";
|
|
8
|
+
import $ from "./Count.js";
|
|
9
9
|
import z from "../config-provider/context.js";
|
|
10
|
-
const
|
|
10
|
+
const x = [
|
|
11
11
|
"red",
|
|
12
12
|
"orangered",
|
|
13
13
|
"orange",
|
|
@@ -23,70 +23,70 @@ const N = [
|
|
|
23
23
|
count: 0,
|
|
24
24
|
maxCount: 99
|
|
25
25
|
};
|
|
26
|
-
function L(
|
|
27
|
-
const { getPrefixCls:
|
|
28
|
-
|
|
26
|
+
function L(y, N) {
|
|
27
|
+
const { getPrefixCls: h, componentConfig: S, rtl: b } = _(z), O = k(
|
|
28
|
+
y,
|
|
29
29
|
I,
|
|
30
|
-
|
|
30
|
+
S?.Badge
|
|
31
31
|
), {
|
|
32
32
|
count: o,
|
|
33
|
-
prefixText:
|
|
33
|
+
prefixText: c,
|
|
34
34
|
text: m,
|
|
35
35
|
className: B,
|
|
36
|
-
dotClassName:
|
|
37
|
-
dot:
|
|
38
|
-
dotAnimation:
|
|
39
|
-
maxCount:
|
|
36
|
+
dotClassName: a,
|
|
37
|
+
dot: p,
|
|
38
|
+
dotAnimation: P = !0,
|
|
39
|
+
maxCount: T,
|
|
40
40
|
color: e,
|
|
41
|
-
dotStyle:
|
|
42
|
-
offset:
|
|
43
|
-
style:
|
|
41
|
+
dotStyle: A,
|
|
42
|
+
offset: D,
|
|
43
|
+
style: E,
|
|
44
44
|
status: l,
|
|
45
|
-
children:
|
|
45
|
+
children: u,
|
|
46
46
|
...j
|
|
47
|
-
} = O, t =
|
|
48
|
-
|
|
47
|
+
} = O, t = h?.("badge"), r = { ...A || {} }, [f, d] = D || [];
|
|
48
|
+
f && (r.marginRight = -f), d && (r.marginTop = d);
|
|
49
49
|
const w = () => {
|
|
50
50
|
if (R(o))
|
|
51
51
|
return /* @__PURE__ */ s(
|
|
52
52
|
"span",
|
|
53
53
|
{
|
|
54
|
-
className:
|
|
54
|
+
className: n(`${t}-custom-dot`, a),
|
|
55
55
|
style: r,
|
|
56
56
|
children: o
|
|
57
57
|
}
|
|
58
58
|
);
|
|
59
|
-
const
|
|
59
|
+
const i = !e || x.indexOf(e) > -1 ? {} : { backgroundColor: e };
|
|
60
60
|
return m && !e && !l ? /* @__PURE__ */ s(
|
|
61
61
|
"span",
|
|
62
62
|
{
|
|
63
|
-
className:
|
|
63
|
+
className: n(`${t}-text`, a),
|
|
64
64
|
style: r,
|
|
65
65
|
children: m
|
|
66
66
|
}
|
|
67
|
-
) : l || e && typeof o == "number" && o <= 0 ? /* @__PURE__ */
|
|
68
|
-
!!
|
|
67
|
+
) : l || e && typeof o == "number" && o <= 0 ? /* @__PURE__ */ g("span", { className: `${t}-status-wrapper`, children: [
|
|
68
|
+
!!c && /* @__PURE__ */ s("span", { className: `${t}-status-prefix-text`, children: c }),
|
|
69
69
|
/* @__PURE__ */ s(
|
|
70
70
|
"span",
|
|
71
71
|
{
|
|
72
|
-
className:
|
|
72
|
+
className: n(
|
|
73
73
|
`${t}-status-dot`,
|
|
74
74
|
{
|
|
75
|
-
[`${t}-status-dot-animation`]:
|
|
75
|
+
[`${t}-status-dot-animation`]: P,
|
|
76
76
|
[`${t}-status-${l}`]: l,
|
|
77
77
|
[`${t}-color-${e}`]: e
|
|
78
78
|
},
|
|
79
|
-
|
|
79
|
+
a
|
|
80
80
|
),
|
|
81
|
-
style: { ...
|
|
81
|
+
style: { ...i, ...r }
|
|
82
82
|
}
|
|
83
83
|
),
|
|
84
84
|
!!m && /* @__PURE__ */ s("span", { className: `${t}-status-text`, children: m })
|
|
85
|
-
] }) : (
|
|
85
|
+
] }) : (p || e) && typeof o == "number" && o > 0 ? /* @__PURE__ */ s(
|
|
86
86
|
q,
|
|
87
87
|
{
|
|
88
88
|
classNames: "badge-zoom",
|
|
89
|
-
in:
|
|
89
|
+
in: p || !!e,
|
|
90
90
|
timeout: 200,
|
|
91
91
|
appear: !0,
|
|
92
92
|
mountOnEnter: !0,
|
|
@@ -94,45 +94,45 @@ function L(h, S) {
|
|
|
94
94
|
children: /* @__PURE__ */ s(
|
|
95
95
|
"span",
|
|
96
96
|
{
|
|
97
|
-
className:
|
|
97
|
+
className: n(
|
|
98
98
|
`${t}-dot`,
|
|
99
99
|
{
|
|
100
100
|
[`${t}-color-${e}`]: e
|
|
101
101
|
},
|
|
102
|
-
|
|
102
|
+
a
|
|
103
103
|
),
|
|
104
|
-
style: { ...
|
|
104
|
+
style: { ...i, ...r }
|
|
105
105
|
}
|
|
106
106
|
)
|
|
107
107
|
}
|
|
108
108
|
) : /* @__PURE__ */ s(
|
|
109
|
-
|
|
109
|
+
$,
|
|
110
110
|
{
|
|
111
111
|
prefixCls: t,
|
|
112
|
-
className:
|
|
113
|
-
style: { ...
|
|
114
|
-
maxCount:
|
|
112
|
+
className: n(`${t}-number`, a),
|
|
113
|
+
style: { ...i, ...r },
|
|
114
|
+
maxCount: T,
|
|
115
115
|
count: o
|
|
116
116
|
}
|
|
117
117
|
);
|
|
118
118
|
};
|
|
119
|
-
return /* @__PURE__ */
|
|
119
|
+
return /* @__PURE__ */ g(
|
|
120
120
|
"span",
|
|
121
121
|
{
|
|
122
|
-
className:
|
|
122
|
+
className: n(
|
|
123
123
|
t,
|
|
124
124
|
{
|
|
125
125
|
[`${t}-status`]: l,
|
|
126
|
-
[`${t}-no-children`]: !
|
|
126
|
+
[`${t}-no-children`]: !u,
|
|
127
127
|
[`${t}-rtl`]: b
|
|
128
128
|
},
|
|
129
129
|
B
|
|
130
130
|
),
|
|
131
|
-
ref:
|
|
132
|
-
style:
|
|
131
|
+
ref: N,
|
|
132
|
+
style: E,
|
|
133
133
|
...j,
|
|
134
134
|
children: [
|
|
135
|
-
|
|
135
|
+
u,
|
|
136
136
|
w()
|
|
137
137
|
]
|
|
138
138
|
}
|
|
@@ -140,11 +140,11 @@ function L(h, S) {
|
|
|
140
140
|
}
|
|
141
141
|
const C = G(L);
|
|
142
142
|
C.displayName = "Badge";
|
|
143
|
-
C.Count =
|
|
144
|
-
const W =
|
|
143
|
+
C.Count = $;
|
|
144
|
+
const W = x, X = ["default", "processing", "success", "warning", "error"];
|
|
145
145
|
export {
|
|
146
146
|
W as BADGE_COLORS,
|
|
147
147
|
X as BADGE_STATUS,
|
|
148
|
-
|
|
148
|
+
$ as BadgeCount,
|
|
149
149
|
C as default
|
|
150
150
|
};
|
package/breadcrumb/Item.js
CHANGED
|
@@ -1,67 +1,66 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { useState as
|
|
5
|
-
import
|
|
1
|
+
import { jsxs as b, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import g from "@unicom-cloud/icons/IconUiDown";
|
|
3
|
+
import C from "lodash/isString";
|
|
4
|
+
import { useState as V } from "react";
|
|
5
|
+
import $ from "../dropdown/index.js";
|
|
6
6
|
import n from "@unicom-cloud/utils/class-name";
|
|
7
|
-
import { omit as
|
|
8
|
-
import { pickDataAttributes as
|
|
9
|
-
function
|
|
7
|
+
import { omit as x } from "../components/common/utils/omit.js";
|
|
8
|
+
import { pickDataAttributes as D } from "../components/common/utils/pick.js";
|
|
9
|
+
function I(a) {
|
|
10
10
|
const {
|
|
11
|
-
children:
|
|
12
|
-
style:
|
|
13
|
-
className:
|
|
14
|
-
prefixCls:
|
|
15
|
-
droplist:
|
|
16
|
-
dropdownProps:
|
|
17
|
-
href:
|
|
18
|
-
onClick:
|
|
19
|
-
tagName:
|
|
20
|
-
...
|
|
21
|
-
} =
|
|
22
|
-
|
|
11
|
+
children: d,
|
|
12
|
+
style: p,
|
|
13
|
+
className: l,
|
|
14
|
+
prefixCls: o,
|
|
15
|
+
droplist: e,
|
|
16
|
+
dropdownProps: r,
|
|
17
|
+
href: t,
|
|
18
|
+
onClick: c,
|
|
19
|
+
tagName: f = "div",
|
|
20
|
+
...h
|
|
21
|
+
} = a, [w, N] = V(!1), u = C(t) ? "a" : f, m = /* @__PURE__ */ b(
|
|
22
|
+
u,
|
|
23
23
|
{
|
|
24
|
-
href:
|
|
25
|
-
onClick:
|
|
24
|
+
href: t,
|
|
25
|
+
onClick: c,
|
|
26
26
|
role: "listitem",
|
|
27
|
-
style:
|
|
27
|
+
style: p,
|
|
28
28
|
className: n(
|
|
29
|
-
`${
|
|
29
|
+
`${o}-item`,
|
|
30
30
|
{
|
|
31
|
-
[`${
|
|
31
|
+
[`${o}-item-with-dropdown`]: e
|
|
32
32
|
},
|
|
33
|
-
|
|
33
|
+
l
|
|
34
34
|
),
|
|
35
|
-
...
|
|
35
|
+
...D(h),
|
|
36
36
|
children: [
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
d,
|
|
38
|
+
e && /* @__PURE__ */ i(
|
|
39
39
|
"span",
|
|
40
40
|
{
|
|
41
41
|
"aria-hidden": !0,
|
|
42
|
-
className: n(`${
|
|
43
|
-
[`${
|
|
42
|
+
className: n(`${o}-item-dropdown-icon`, {
|
|
43
|
+
[`${o}-item-dropdown-icon-active`]: w
|
|
44
44
|
}),
|
|
45
|
-
children: /* @__PURE__ */
|
|
45
|
+
children: /* @__PURE__ */ i(g, {})
|
|
46
46
|
}
|
|
47
47
|
)
|
|
48
48
|
]
|
|
49
49
|
}
|
|
50
50
|
);
|
|
51
|
-
return
|
|
52
|
-
|
|
51
|
+
return e ? /* @__PURE__ */ i(
|
|
52
|
+
$,
|
|
53
53
|
{
|
|
54
|
-
droplist:
|
|
55
|
-
onVisibleChange: (
|
|
56
|
-
|
|
57
|
-
b(a), (s = e == null ? void 0 : e.onVisibleChange) == null || s.call(e, a);
|
|
54
|
+
droplist: e,
|
|
55
|
+
onVisibleChange: (s) => {
|
|
56
|
+
N(s), r?.onVisibleChange?.(s);
|
|
58
57
|
},
|
|
59
|
-
...
|
|
60
|
-
children:
|
|
58
|
+
...x(r, ["onVisibleChange"]),
|
|
59
|
+
children: m
|
|
61
60
|
}
|
|
62
|
-
) :
|
|
61
|
+
) : m;
|
|
63
62
|
}
|
|
64
|
-
|
|
63
|
+
I.displayName = "BreadcrumbItem";
|
|
65
64
|
export {
|
|
66
|
-
|
|
65
|
+
I as default
|
|
67
66
|
};
|